Skip to content

Commit 98c7eb5

Browse files
committed
Updated documentation
1 parent 1db5e80 commit 98c7eb5

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

README.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,8 @@ as the code of the project relies on the
824824
https://github.com/fabric8io/kubernetes-client[Fabric8 Kubernetes Java client], which is a fluent DSL that can
825825
communicate by using `http` protocol to the REST API of the Kubernetes Server.
826826

827+
To disable the integration with Kubernetes you can set `spring.cloud.kubernetes.enabled` to `false`.
828+
827829
=== Kubernetes Profile Autoconfiguration
828830

829831
When the application runs as a pod inside Kubernetes, a Spring profile named `kubernetes` automatically gets activated.

docs/src/main/asciidoc/_configprops.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
|===
22
|Name | Default | Description
33

4-
|spring.cloud.kubernetes.enabled | true | If Kubernetes integration is enabled.
54
|spring.cloud.kubernetes.client.api-version | |
65
|spring.cloud.kubernetes.client.apiVersion | v1 | Kubernetes API Version
76
|spring.cloud.kubernetes.client.ca-cert-data | |
@@ -63,6 +62,7 @@
6362
|spring.cloud.kubernetes.discovery.primary-port-name | | If set then the port with a given name is used as primary when multiple ports are defined for a service.
6463
|spring.cloud.kubernetes.discovery.service-labels | | If set, then only the services matching these labels will be fetched from the Kubernetes API server.
6564
|spring.cloud.kubernetes.discovery.service-name | unknown | The service name of the local instance.
65+
|spring.cloud.kubernetes.enabled | true | If Kubernetes integration is enabled.
6666
|spring.cloud.kubernetes.reload.enabled | false | Enables the Kubernetes configuration reload on change.
6767
|spring.cloud.kubernetes.reload.max-wait-for-restart | 2s | If Restart or Shutdown strategies are used, Spring Cloud Kubernetes waits a random amount of time before restarting. This is done in order to avoid having all instances of the same application restart at the same time. This property configures the maximum of amount of wait time from the moment the signal is received that a restart is needed until the moment the restart is actually triggered
6868
|spring.cloud.kubernetes.reload.mode | | Sets the detection mode for Kubernetes configuration reload.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2013-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.kubernetes;
18+
19+
import org.springframework.boot.context.properties.ConfigurationProperties;
20+
import org.springframework.core.style.ToStringCreator;
21+
22+
/**
23+
* Kubernetes properties.
24+
*
25+
* @author Tim Ysewyn
26+
*/
27+
@ConfigurationProperties("spring.cloud.kubernetes")
28+
public class KubernetesProperties {
29+
30+
/** If Kubernetes integration is enabled. */
31+
private boolean enabled = true;
32+
33+
public boolean isEnabled() {
34+
return enabled;
35+
}
36+
37+
public void setEnabled(boolean enabled) {
38+
this.enabled = enabled;
39+
}
40+
41+
@Override
42+
public String toString() {
43+
return new ToStringCreator(this).append("enabled", this.enabled).toString();
44+
}
45+
46+
}

0 commit comments

Comments
 (0)