From 288b4765908d8a41bd1e0143d0edd830e7ca898a Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 10 Sep 2019 15:27:58 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/README.html | 188 ++++---- reference/html/appendix.html | 473 ++++++++++++++++++++ reference/html/index.html | 188 ++++---- reference/html/spring-cloud-kubernetes.html | 188 ++++---- 4 files changed, 788 insertions(+), 249 deletions(-) create mode 100644 reference/html/appendix.html diff --git a/reference/html/README.html b/reference/html/README.html index cb8d2433..cc970644 100644 --- a/reference/html/README.html +++ b/reference/html/README.html @@ -96,49 +96,63 @@ $(addBlockSwitches);
Table of Contents
@@ -153,7 +167,7 @@ $(addBlockSwitches);
-

Why do you need Spring Cloud Kubernetes?

+

1. Why do you need Spring Cloud Kubernetes?

Spring Cloud Kubernetes provide Spring Cloud common interface implementations that consume Kubernetes native services. @@ -162,7 +176,7 @@ The main objective of the projects provided in this repository is to facilitate

-

Starters

+

2. Starters

Starters are convenient dependency descriptors you can include in your @@ -190,7 +204,7 @@ auto-configuration for a feature set.

</dependency>
-

Discovery Client implementation that +

Discovery Client implementation that resolves service names to Kubernetes Services.

@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.

Load application properties from Kubernetes -ConfigMaps and Secrets. +ConfigMaps and Secrets. Reload application properties when a ConfigMap or Secret changes.

@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.

-

DiscoveryClient for Kubernetes

+

3. DiscoveryClient for Kubernetes

This project provides an implementation of Discovery Client @@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the sprin

-

Kubernetes native service discovery

+

4. Kubernetes native service discovery

-

Kubernetes itself is capable of (server side) service discovery (see: https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services). -Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (https://istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

+

Kubernetes itself is capable of (server side) service discovery (see: kubernetes.io/docs/concepts/services-networking/service/#discovering-services). +Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

-

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}.

+

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as {service-name}.{namespace}.svc.{cluster}.local:{service-port}.

Additionally, you can use Hystrix for:

@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
-

Kubernetes PropertySource implementations

+

5. Kubernetes PropertySource implementations

The most common approach to configuring your Spring Boot application is to create an application.properties or application.yaml or @@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif variables.

-

Using a ConfigMap PropertySource

+

5.1. Using a ConfigMap PropertySource

Kubernetes provides a resource named ConfigMap to externalize the parameters to pass to your application in the form of key-value pairs or embedded application.properties or application.yaml files. @@ -680,13 +694,13 @@ spec: metadata: labels: app: deployment-name - spec: - containers: - - name: container-name - image: your-image - env: - - name: SPRING_PROFILES_ACTIVE - value: "development" + spec: + containers: + - name: container-name + image: your-image + env: + - name: SPRING_PROFILES_ACTIVE + value: "development"

@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
-

Secrets PropertySource

+

5.2. Secrets PropertySource

Kubernetes has the notion of Secrets for storing sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with Secrets to make secrets @@ -1052,7 +1066,7 @@ the Secret named s1 would be looked up in the namespac

-

PropertySource Reload

+

5.3. PropertySource Reload

Some applications may need to detect changes on external property sources and update their internal status to reflect the new configuration. The reload feature of Spring Cloud Kubernetes is able to trigger an application reload when a related ConfigMap or @@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does

-

Ribbon Discovery in Kubernetes

+

6. Ribbon Discovery in Kubernetes

Spring Cloud client applications that call a microservice should be interested on relying on a client load-balancing @@ -1364,7 +1378,7 @@ You can disable the Ribbon discovery client by setting the spring.cloud.ku

-

Kubernetes Ecosystem Awareness

+

7. Kubernetes Ecosystem Awareness

All of the features described earlier in this guide work equally well, regardless of whether your application is running inside @@ -1376,7 +1390,7 @@ as the code of the project relies on the communicate by using http protocol to the REST API of the Kubernetes Server.

-

Kubernetes Profile Autoconfiguration

+

7.1. Kubernetes Profile Autoconfiguration

When the application runs as a pod inside Kubernetes, a Spring profile named kubernetes automatically gets activated. This lets you customize the configuration, to define beans that are applied when the Spring Boot application is deployed @@ -1384,7 +1398,7 @@ within the Kubernetes platform (for example, different development and productio

-

Istio Awareness

+

7.2. Istio Awareness

When you include the spring-cloud-kubernetes-istio module in the application classpath, a new profile is added to the application, provided the application is running inside a Kubernetes Cluster with Istio installed. You can then use @@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica

-

Pod Health Indicator

+

8. Pod Health Indicator

Spring Boot uses HealthIndicator to expose info about the health of an application. @@ -1420,7 +1434,7 @@ That makes it really useful for exposing health-related information to the user

-

Leader Election

+

9. Leader Election

<TBD>

@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
-

Security Configurations Inside Kubernetes

+

10. Security Configurations Inside Kubernetes

-

Namespace

+

10.1. Namespace

Most of the components provided in this project need to know the namespace. For Kubernetes (1.3+), the namespace is made available to the pod as part of the service account secret and is automatically detected by the client. For earlier versions, it needs to be specified as an environment variable to the pod. A quick way to do this is as follows:

@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
-

Service Account

+

10.2. Service Account

For distributions of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles.

@@ -1529,7 +1543,7 @@ roleRef:
-

Service Registry Implementation

+

11. Service Registry Implementation

In Kubernetes service registration is controlled by the platform, the application itself does not control @@ -1539,7 +1553,7 @@ or setting @EnableDiscoveryClient(autoRegister=false) will have no

-

Examples

+

12. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by @@ -1584,7 +1598,7 @@ The same applies for PropertySourceLocator, where you need to add t

-

Other Resources

+

13. Other Resources

This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.

@@ -1605,10 +1619,18 @@ The same applies for PropertySourceLocator, where you need to add t
-

Building

+

14. Configuration properties

+
+
+

To see the list of all Sleuth related configuration properties please check the Appendix page.

+
+
+
+
+

15. Building

-

Basic Compile and Test

+

15.1. Basic Compile and Test

To build the source you will need to install JDK 1.7.

@@ -1686,7 +1708,7 @@ If all else fails, build with the command from .travis.yml (usually
-

Documentation

+

15.2. Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from @@ -1699,7 +1721,7 @@ a modified file in the correct place. Just commit it and push the change.

-

Working with the code

+

15.3. Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or @@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.

should also work without issue as long as they use Maven 3.3.3 or better.

-

Importing into eclipse with m2eclipse

+

15.3.1. Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse @@ -1735,7 +1757,7 @@ pom into your settings.xml.

-

Importing into eclipse without m2eclipse

+

15.3.2. Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command:

@@ -1754,7 +1776,7 @@ from the file menu.

-

Contributing

+

16. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, @@ -1764,7 +1786,7 @@ to contribute even something trivial please do not hesitate, but follow the guidelines below.

-

Sign the Contributor License Agreement

+

16.1. Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. @@ -1775,7 +1797,7 @@ given the ability to merge pull requests.

-

Code of Conduct

+

16.2. Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report @@ -1783,7 +1805,7 @@ unacceptable behavior to spri

-

Code Conventions and Housekeeping

+

16.3. Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).

-

Checkstyle

+

16.4. Checkstyle

Spring Cloud Build comes with a set of checkstyle rules. You can find them in the spring-cloud-build-tools module. The most notable files under the module are:

@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).

-

Checkstyle configuration

+

16.4.1. Checkstyle configuration

Checkstyle rules are disabled by default. To add checkstyle to your project just define the following properties and plugins.

@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).

<?xml version="1.0"?>
 <!DOCTYPE suppressions PUBLIC
-		"-//Puppy Crawl//DTD Suppressions 1.1//EN"
-		"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
 <suppressions>
-	<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
-	<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
+    <suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
+    <suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
 </suppressions>
@@ -1954,9 +1976,9 @@ $ touch .springformat
-

IDE setup

+

16.5. IDE setup

-

Intellij IDEA

+

16.5.1. Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin. The following files can be found in the Spring Cloud Build project.

@@ -2028,15 +2050,15 @@ The following files can be found in the -

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

+

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

  • -

    checkstyle.header.file - please point it to the Spring Cloud Build’s, spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt file either in your cloned repo or via the https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt URL.

    +

    checkstyle.header.file - please point it to the Spring Cloud Build’s, spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt file either in your cloned repo or via the raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt URL.

  • -

    checkstyle.suppressions.file - default suppressions. Please point it to the Spring Cloud Build’s, spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml file either in your cloned repo or via the https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml URL.

    +

    checkstyle.suppressions.file - default suppressions. Please point it to the Spring Cloud Build’s, spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml file either in your cloned repo or via the raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml URL.

  • checkstyle.additional.suppressions.file - this variable corresponds to suppressions in your local project. E.g. you’re working on spring-cloud-contract. Then point to the project-root/src/checkstyle/checkstyle-suppressions.xml folder. Example for spring-cloud-contract would be: /home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml.

    diff --git a/reference/html/appendix.html b/reference/html/appendix.html new file mode 100644 index 00000000..f5296dae --- /dev/null +++ b/reference/html/appendix.html @@ -0,0 +1,473 @@ + + + + + + + +Common application properties + + + + + + + + + + +
    +
    +

    Appendix A: Common application properties

    +
    +
    +

    Various properties can be specified inside your application.properties file, inside your application.yml file, or as command line switches. +This appendix provides a list of common Spring Cloud Kubernetes properties and references to the underlying classes that consume them.

    +
    +
    + + + + + +
    + + +Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. +Also, you can define your own properties. +
    +
    + +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDefaultDescription

    spring.cloud.kubernetes.client.api-version

    spring.cloud.kubernetes.client.apiVersion

    v1

    Kubernetes API Version

    spring.cloud.kubernetes.client.ca-cert-data

    spring.cloud.kubernetes.client.ca-cert-file

    spring.cloud.kubernetes.client.caCertData

    Kubernetes API CACertData

    spring.cloud.kubernetes.client.caCertFile

    Kubernetes API CACertFile

    spring.cloud.kubernetes.client.client-cert-data

    spring.cloud.kubernetes.client.client-cert-file

    spring.cloud.kubernetes.client.client-key-algo

    spring.cloud.kubernetes.client.client-key-data

    spring.cloud.kubernetes.client.client-key-file

    spring.cloud.kubernetes.client.client-key-passphrase

    spring.cloud.kubernetes.client.clientCertData

    Kubernetes API ClientCertData

    spring.cloud.kubernetes.client.clientCertFile

    Kubernetes API ClientCertFile

    spring.cloud.kubernetes.client.clientKeyAlgo

    RSA

    Kubernetes API ClientKeyAlgo

    spring.cloud.kubernetes.client.clientKeyData

    Kubernetes API ClientKeyData

    spring.cloud.kubernetes.client.clientKeyFile

    Kubernetes API ClientKeyFile

    spring.cloud.kubernetes.client.clientKeyPassphrase

    changeit

    Kubernetes API ClientKeyPassphrase

    spring.cloud.kubernetes.client.connection-timeout

    spring.cloud.kubernetes.client.connectionTimeout

    10s

    Connection timeout

    spring.cloud.kubernetes.client.http-proxy

    spring.cloud.kubernetes.client.https-proxy

    spring.cloud.kubernetes.client.logging-interval

    spring.cloud.kubernetes.client.loggingInterval

    20s

    Logging interval

    spring.cloud.kubernetes.client.master-url

    spring.cloud.kubernetes.client.masterUrl

    kubernetes.default.svc

    Kubernetes API Master Node URL

    spring.cloud.kubernetes.client.namespace

    true

    Kubernetes Namespace

    spring.cloud.kubernetes.client.no-proxy

    spring.cloud.kubernetes.client.password

    Kubernetes API Password

    spring.cloud.kubernetes.client.proxy-password

    spring.cloud.kubernetes.client.proxy-username

    spring.cloud.kubernetes.client.request-timeout

    spring.cloud.kubernetes.client.requestTimeout

    10s

    Request timeout

    spring.cloud.kubernetes.client.rolling-timeout

    spring.cloud.kubernetes.client.rollingTimeout

    900s

    Rolling timeout

    spring.cloud.kubernetes.client.trust-certs

    spring.cloud.kubernetes.client.trustCerts

    false

    Kubernetes API Trust Certificates

    spring.cloud.kubernetes.client.username

    Kubernetes API Username

    spring.cloud.kubernetes.client.watch-reconnect-interval

    spring.cloud.kubernetes.client.watch-reconnect-limit

    spring.cloud.kubernetes.client.watchReconnectInterval

    1s

    Reconnect Interval

    spring.cloud.kubernetes.client.watchReconnectLimit

    -1

    Reconnect Interval limit retries

    spring.cloud.kubernetes.config.enable-api

    true

    spring.cloud.kubernetes.config.enabled

    true

    Enable the ConfigMap property source locator.

    spring.cloud.kubernetes.config.name

    spring.cloud.kubernetes.config.namespace

    spring.cloud.kubernetes.config.paths

    spring.cloud.kubernetes.config.sources

    spring.cloud.kubernetes.reload.enabled

    false

    Enables the Kubernetes configuration reload on change.

    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

    spring.cloud.kubernetes.reload.mode

    Sets the detection mode for Kubernetes configuration reload.

    spring.cloud.kubernetes.reload.monitoring-config-maps

    true

    Enables monitoring on config maps to detect changes.

    spring.cloud.kubernetes.reload.monitoring-secrets

    false

    Enables monitoring on secrets to detect changes.

    spring.cloud.kubernetes.reload.period

    15000ms

    Sets the polling period to use when the detection mode is POLLING.

    spring.cloud.kubernetes.reload.strategy

    Sets the reload strategy for Kubernetes configuration reload on change.

    spring.cloud.kubernetes.ribbon.cluster-domain

    cluster.local

    cluster domain.

    spring.cloud.kubernetes.ribbon.enabled

    true

    Ribbon enabled,default true.

    spring.cloud.kubernetes.ribbon.mode

    {@link KubernetesRibbonMode} setting ribbon server list with ip of pod or service name. default value is POD.

    spring.cloud.kubernetes.secrets.enable-api

    false

    spring.cloud.kubernetes.secrets.enabled

    true

    Enable the Secrets property source locator.

    spring.cloud.kubernetes.secrets.labels

    spring.cloud.kubernetes.secrets.name

    spring.cloud.kubernetes.secrets.namespace

    spring.cloud.kubernetes.secrets.paths

    spring.cloud.kubernetes.secrets.sources

    +
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/reference/html/index.html b/reference/html/index.html index cb8d2433..cc970644 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -96,49 +96,63 @@ $(addBlockSwitches);
    Table of Contents
    @@ -153,7 +167,7 @@ $(addBlockSwitches);
-

Why do you need Spring Cloud Kubernetes?

+

1. Why do you need Spring Cloud Kubernetes?

Spring Cloud Kubernetes provide Spring Cloud common interface implementations that consume Kubernetes native services. @@ -162,7 +176,7 @@ The main objective of the projects provided in this repository is to facilitate

-

Starters

+

2. Starters

Starters are convenient dependency descriptors you can include in your @@ -190,7 +204,7 @@ auto-configuration for a feature set.

</dependency>
-

Discovery Client implementation that +

Discovery Client implementation that resolves service names to Kubernetes Services.

@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.

Load application properties from Kubernetes -ConfigMaps and Secrets. +ConfigMaps and Secrets. Reload application properties when a ConfigMap or Secret changes.

@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.

-

DiscoveryClient for Kubernetes

+

3. DiscoveryClient for Kubernetes

This project provides an implementation of Discovery Client @@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the sprin

-

Kubernetes native service discovery

+

4. Kubernetes native service discovery

-

Kubernetes itself is capable of (server side) service discovery (see: https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services). -Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (https://istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

+

Kubernetes itself is capable of (server side) service discovery (see: kubernetes.io/docs/concepts/services-networking/service/#discovering-services). +Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

-

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}.

+

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as {service-name}.{namespace}.svc.{cluster}.local:{service-port}.

Additionally, you can use Hystrix for:

@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
-

Kubernetes PropertySource implementations

+

5. Kubernetes PropertySource implementations

The most common approach to configuring your Spring Boot application is to create an application.properties or application.yaml or @@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif variables.

-

Using a ConfigMap PropertySource

+

5.1. Using a ConfigMap PropertySource

Kubernetes provides a resource named ConfigMap to externalize the parameters to pass to your application in the form of key-value pairs or embedded application.properties or application.yaml files. @@ -680,13 +694,13 @@ spec: metadata: labels: app: deployment-name - spec: - containers: - - name: container-name - image: your-image - env: - - name: SPRING_PROFILES_ACTIVE - value: "development" + spec: + containers: + - name: container-name + image: your-image + env: + - name: SPRING_PROFILES_ACTIVE + value: "development"

@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
-

Secrets PropertySource

+

5.2. Secrets PropertySource

Kubernetes has the notion of Secrets for storing sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with Secrets to make secrets @@ -1052,7 +1066,7 @@ the Secret named s1 would be looked up in the namespac

-

PropertySource Reload

+

5.3. PropertySource Reload

Some applications may need to detect changes on external property sources and update their internal status to reflect the new configuration. The reload feature of Spring Cloud Kubernetes is able to trigger an application reload when a related ConfigMap or @@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does

-

Ribbon Discovery in Kubernetes

+

6. Ribbon Discovery in Kubernetes

Spring Cloud client applications that call a microservice should be interested on relying on a client load-balancing @@ -1364,7 +1378,7 @@ You can disable the Ribbon discovery client by setting the spring.cloud.ku

-

Kubernetes Ecosystem Awareness

+

7. Kubernetes Ecosystem Awareness

All of the features described earlier in this guide work equally well, regardless of whether your application is running inside @@ -1376,7 +1390,7 @@ as the code of the project relies on the communicate by using http protocol to the REST API of the Kubernetes Server.

-

Kubernetes Profile Autoconfiguration

+

7.1. Kubernetes Profile Autoconfiguration

When the application runs as a pod inside Kubernetes, a Spring profile named kubernetes automatically gets activated. This lets you customize the configuration, to define beans that are applied when the Spring Boot application is deployed @@ -1384,7 +1398,7 @@ within the Kubernetes platform (for example, different development and productio

-

Istio Awareness

+

7.2. Istio Awareness

When you include the spring-cloud-kubernetes-istio module in the application classpath, a new profile is added to the application, provided the application is running inside a Kubernetes Cluster with Istio installed. You can then use @@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica

-

Pod Health Indicator

+

8. Pod Health Indicator

Spring Boot uses HealthIndicator to expose info about the health of an application. @@ -1420,7 +1434,7 @@ That makes it really useful for exposing health-related information to the user

-

Leader Election

+

9. Leader Election

<TBD>

@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
-

Security Configurations Inside Kubernetes

+

10. Security Configurations Inside Kubernetes

-

Namespace

+

10.1. Namespace

Most of the components provided in this project need to know the namespace. For Kubernetes (1.3+), the namespace is made available to the pod as part of the service account secret and is automatically detected by the client. For earlier versions, it needs to be specified as an environment variable to the pod. A quick way to do this is as follows:

@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
-

Service Account

+

10.2. Service Account

For distributions of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles.

@@ -1529,7 +1543,7 @@ roleRef:
-

Service Registry Implementation

+

11. Service Registry Implementation

In Kubernetes service registration is controlled by the platform, the application itself does not control @@ -1539,7 +1553,7 @@ or setting @EnableDiscoveryClient(autoRegister=false) will have no

-

Examples

+

12. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by @@ -1584,7 +1598,7 @@ The same applies for PropertySourceLocator, where you need to add t

-

Other Resources

+

13. Other Resources

This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.

@@ -1605,10 +1619,18 @@ The same applies for PropertySourceLocator, where you need to add t
-

Building

+

14. Configuration properties

+
+
+

To see the list of all Sleuth related configuration properties please check the Appendix page.

+
+
+
+
+

15. Building

-

Basic Compile and Test

+

15.1. Basic Compile and Test

To build the source you will need to install JDK 1.7.

@@ -1686,7 +1708,7 @@ If all else fails, build with the command from .travis.yml (usually
-

Documentation

+

15.2. Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from @@ -1699,7 +1721,7 @@ a modified file in the correct place. Just commit it and push the change.

-

Working with the code

+

15.3. Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or @@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.

should also work without issue as long as they use Maven 3.3.3 or better.

-

Importing into eclipse with m2eclipse

+

15.3.1. Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse @@ -1735,7 +1757,7 @@ pom into your settings.xml.

-

Importing into eclipse without m2eclipse

+

15.3.2. Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command:

@@ -1754,7 +1776,7 @@ from the file menu.

-

Contributing

+

16. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, @@ -1764,7 +1786,7 @@ to contribute even something trivial please do not hesitate, but follow the guidelines below.

-

Sign the Contributor License Agreement

+

16.1. Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. @@ -1775,7 +1797,7 @@ given the ability to merge pull requests.

-

Code of Conduct

+

16.2. Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report @@ -1783,7 +1805,7 @@ unacceptable behavior to spri

-

Code Conventions and Housekeeping

+

16.3. Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).

-

Checkstyle

+

16.4. Checkstyle

Spring Cloud Build comes with a set of checkstyle rules. You can find them in the spring-cloud-build-tools module. The most notable files under the module are:

@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).

-

Checkstyle configuration

+

16.4.1. Checkstyle configuration

Checkstyle rules are disabled by default. To add checkstyle to your project just define the following properties and plugins.

@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).

<?xml version="1.0"?>
 <!DOCTYPE suppressions PUBLIC
-		"-//Puppy Crawl//DTD Suppressions 1.1//EN"
-		"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
 <suppressions>
-	<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
-	<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
+    <suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
+    <suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
 </suppressions>
@@ -1954,9 +1976,9 @@ $ touch .springformat
-

IDE setup

+

16.5. IDE setup

-

Intellij IDEA

+

16.5.1. Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin. The following files can be found in the Spring Cloud Build project.

@@ -2028,15 +2050,15 @@ The following files can be found in the -

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

+

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

-

Why do you need Spring Cloud Kubernetes?

+

1. Why do you need Spring Cloud Kubernetes?

Spring Cloud Kubernetes provide Spring Cloud common interface implementations that consume Kubernetes native services. @@ -162,7 +176,7 @@ The main objective of the projects provided in this repository is to facilitate

-

Starters

+

2. Starters

Starters are convenient dependency descriptors you can include in your @@ -190,7 +204,7 @@ auto-configuration for a feature set.

</dependency>
-

Discovery Client implementation that +

Discovery Client implementation that resolves service names to Kubernetes Services.

@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.

Load application properties from Kubernetes -ConfigMaps and Secrets. +ConfigMaps and Secrets. Reload application properties when a ConfigMap or Secret changes.

@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.

-

DiscoveryClient for Kubernetes

+

3. DiscoveryClient for Kubernetes

This project provides an implementation of Discovery Client @@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the sprin

-

Kubernetes native service discovery

+

4. Kubernetes native service discovery

-

Kubernetes itself is capable of (server side) service discovery (see: https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services). -Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (https://istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

+

Kubernetes itself is capable of (server side) service discovery (see: kubernetes.io/docs/concepts/services-networking/service/#discovering-services). +Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (istio.io), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.

-

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}.

+

The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring RestTemplate that refers to a fully qualified domain name (FQDN), such as {service-name}.{namespace}.svc.{cluster}.local:{service-port}.

Additionally, you can use Hystrix for:

@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
-

Kubernetes PropertySource implementations

+

5. Kubernetes PropertySource implementations

The most common approach to configuring your Spring Boot application is to create an application.properties or application.yaml or @@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif variables.

-

Using a ConfigMap PropertySource

+

5.1. Using a ConfigMap PropertySource

Kubernetes provides a resource named ConfigMap to externalize the parameters to pass to your application in the form of key-value pairs or embedded application.properties or application.yaml files. @@ -680,13 +694,13 @@ spec: metadata: labels: app: deployment-name - spec: - containers: - - name: container-name - image: your-image - env: - - name: SPRING_PROFILES_ACTIVE - value: "development" + spec: + containers: + - name: container-name + image: your-image + env: + - name: SPRING_PROFILES_ACTIVE + value: "development"

@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
-

Secrets PropertySource

+

5.2. Secrets PropertySource

Kubernetes has the notion of Secrets for storing sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with Secrets to make secrets @@ -1052,7 +1066,7 @@ the Secret named s1 would be looked up in the namespac

-

PropertySource Reload

+

5.3. PropertySource Reload

Some applications may need to detect changes on external property sources and update their internal status to reflect the new configuration. The reload feature of Spring Cloud Kubernetes is able to trigger an application reload when a related ConfigMap or @@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does

-

Ribbon Discovery in Kubernetes

+

6. Ribbon Discovery in Kubernetes

Spring Cloud client applications that call a microservice should be interested on relying on a client load-balancing @@ -1364,7 +1378,7 @@ You can disable the Ribbon discovery client by setting the spring.cloud.ku

-

Kubernetes Ecosystem Awareness

+

7. Kubernetes Ecosystem Awareness

All of the features described earlier in this guide work equally well, regardless of whether your application is running inside @@ -1376,7 +1390,7 @@ as the code of the project relies on the communicate by using http protocol to the REST API of the Kubernetes Server.

-

Kubernetes Profile Autoconfiguration

+

7.1. Kubernetes Profile Autoconfiguration

When the application runs as a pod inside Kubernetes, a Spring profile named kubernetes automatically gets activated. This lets you customize the configuration, to define beans that are applied when the Spring Boot application is deployed @@ -1384,7 +1398,7 @@ within the Kubernetes platform (for example, different development and productio

-

Istio Awareness

+

7.2. Istio Awareness

When you include the spring-cloud-kubernetes-istio module in the application classpath, a new profile is added to the application, provided the application is running inside a Kubernetes Cluster with Istio installed. You can then use @@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica

-

Pod Health Indicator

+

8. Pod Health Indicator

Spring Boot uses HealthIndicator to expose info about the health of an application. @@ -1420,7 +1434,7 @@ That makes it really useful for exposing health-related information to the user

-

Leader Election

+

9. Leader Election

<TBD>

@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
-

Security Configurations Inside Kubernetes

+

10. Security Configurations Inside Kubernetes

-

Namespace

+

10.1. Namespace

Most of the components provided in this project need to know the namespace. For Kubernetes (1.3+), the namespace is made available to the pod as part of the service account secret and is automatically detected by the client. For earlier versions, it needs to be specified as an environment variable to the pod. A quick way to do this is as follows:

@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
-

Service Account

+

10.2. Service Account

For distributions of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles.

@@ -1529,7 +1543,7 @@ roleRef:
-

Service Registry Implementation

+

11. Service Registry Implementation

In Kubernetes service registration is controlled by the platform, the application itself does not control @@ -1539,7 +1553,7 @@ or setting @EnableDiscoveryClient(autoRegister=false) will have no

-

Examples

+

12. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by @@ -1584,7 +1598,7 @@ The same applies for PropertySourceLocator, where you need to add t

-

Other Resources

+

13. Other Resources

This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.

@@ -1605,10 +1619,18 @@ The same applies for PropertySourceLocator, where you need to add t
-

Building

+

14. Configuration properties

+
+
+

To see the list of all Sleuth related configuration properties please check the Appendix page.

+
+
+
+
+

15. Building

-

Basic Compile and Test

+

15.1. Basic Compile and Test

To build the source you will need to install JDK 1.7.

@@ -1686,7 +1708,7 @@ If all else fails, build with the command from .travis.yml (usually
-

Documentation

+

15.2. Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from @@ -1699,7 +1721,7 @@ a modified file in the correct place. Just commit it and push the change.

-

Working with the code

+

15.3. Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or @@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.

should also work without issue as long as they use Maven 3.3.3 or better.

-

Importing into eclipse with m2eclipse

+

15.3.1. Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse @@ -1735,7 +1757,7 @@ pom into your settings.xml.

-

Importing into eclipse without m2eclipse

+

15.3.2. Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command:

@@ -1754,7 +1776,7 @@ from the file menu.

-

Contributing

+

16. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, @@ -1764,7 +1786,7 @@ to contribute even something trivial please do not hesitate, but follow the guidelines below.

-

Sign the Contributor License Agreement

+

16.1. Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. @@ -1775,7 +1797,7 @@ given the ability to merge pull requests.

-

Code of Conduct

+

16.2. Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report @@ -1783,7 +1805,7 @@ unacceptable behavior to spri

-

Code Conventions and Housekeeping

+

16.3. Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).

-

Checkstyle

+

16.4. Checkstyle

Spring Cloud Build comes with a set of checkstyle rules. You can find them in the spring-cloud-build-tools module. The most notable files under the module are:

@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).

-

Checkstyle configuration

+

16.4.1. Checkstyle configuration

Checkstyle rules are disabled by default. To add checkstyle to your project just define the following properties and plugins.

@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).

<?xml version="1.0"?>
 <!DOCTYPE suppressions PUBLIC
-		"-//Puppy Crawl//DTD Suppressions 1.1//EN"
-		"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
 <suppressions>
-	<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
-	<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
+    <suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
+    <suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
 </suppressions>
@@ -1954,9 +1976,9 @@ $ touch .springformat
-

IDE setup

+

16.5. IDE setup

-

Intellij IDEA

+

16.5.1. Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin. The following files can be found in the Spring Cloud Build project.

@@ -2028,15 +2050,15 @@ The following files can be found in the -

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

+

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables: