Sync docs from master to gh-pages
This commit is contained in:
@@ -96,49 +96,63 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#_starters">Starters</a></li>
|
||||
<li><a href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></li>
|
||||
<li><a href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a>
|
||||
<li><a href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#starters">2. Starters</a></li>
|
||||
<li><a href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></li>
|
||||
<li><a href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#_secrets_propertysource">Secrets PropertySource</a></li>
|
||||
<li><a href="#_propertysource_reload"><code>PropertySource</code> Reload</a></li>
|
||||
<li><a href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#secrets-propertysource">5.2. Secrets PropertySource</a></li>
|
||||
<li><a href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a>
|
||||
<li><a href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#_istio_awareness">Istio Awareness</a></li>
|
||||
<li><a href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#istio-awareness">7.2. Istio Awareness</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_pod_health_indicator">Pod Health Indicator</a></li>
|
||||
<li><a href="#_leader_election">Leader Election</a></li>
|
||||
<li><a href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a>
|
||||
<li><a href="#pod-health-indicator">8. Pod Health Indicator</a></li>
|
||||
<li><a href="#leader-election">9. Leader Election</a></li>
|
||||
<li><a href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_namespace">Namespace</a></li>
|
||||
<li><a href="#_service_account">Service Account</a></li>
|
||||
<li><a href="#namespace">10.1. Namespace</a></li>
|
||||
<li><a href="#service-account">10.2. Service Account</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_service_registry_implementation">Service Registry Implementation</a></li>
|
||||
<li><a href="#_examples">Examples</a></li>
|
||||
<li><a href="#_other_resources">Other Resources</a></li>
|
||||
<li><a href="#_building">Building</a>
|
||||
<li><a href="#service-registry-implementation">11. Service Registry Implementation</a></li>
|
||||
<li><a href="#examples">12. Examples</a></li>
|
||||
<li><a href="#other-resources">13. Other Resources</a></li>
|
||||
<li><a href="#configuration-properties">14. Configuration properties</a></li>
|
||||
<li><a href="#building">15. Building</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_basic_compile_and_test">Basic Compile and Test</a></li>
|
||||
<li><a href="#_documentation">Documentation</a></li>
|
||||
<li><a href="#_working_with_the_code">Working with the code</a></li>
|
||||
<li><a href="#basic-compile-and-test">15.1. Basic Compile and Test</a></li>
|
||||
<li><a href="#documentation">15.2. Documentation</a></li>
|
||||
<li><a href="#working-with-the-code">15.3. Working with the code</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></li>
|
||||
<li><a href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_contributing">Contributing</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#contributing">16. Contributing</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#_code_of_conduct">Code of Conduct</a></li>
|
||||
<li><a href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#_checkstyle">Checkstyle</a></li>
|
||||
<li><a href="#_ide_setup">IDE setup</a></li>
|
||||
<li><a href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#code-of-conduct">16.2. Code of Conduct</a></li>
|
||||
<li><a href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#checkstyle">16.4. Checkstyle</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#ide-setup">16.5. IDE setup</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#intellij-idea">16.5.1. Intellij IDEA</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -153,7 +167,7 @@ $(addBlockSwitches);
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_why_do_you_need_spring_cloud_kubernetes"><a class="link" href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<h2 id="why-do-you-need-spring-cloud-kubernetes"><a class="anchor" href="#why-do-you-need-spring-cloud-kubernetes"></a><a class="link" href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_starters"><a class="link" href="#_starters">Starters</a></h2>
|
||||
<h2 id="starters"><a class="anchor" href="#starters"></a><a class="link" href="#starters">2. Starters</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Starters are convenient dependency descriptors you can include in your
|
||||
@@ -190,7 +204,7 @@ auto-configuration for a feature set.</p>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_discoveryclient_for_kubernetes">Discovery Client</a> implementation that
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#discoveryclient-for-kubernetes">Discovery Client</a> implementation that
|
||||
resolves service names to Kubernetes Services.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.</p></td>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Load application properties from Kubernetes
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#_secrets_propertysource">Secrets</a>.
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#secrets-propertysource">Secrets</a>.
|
||||
<a href="#PropertySource Reload">Reload</a> application properties when a ConfigMap or
|
||||
Secret changes.</p></td>
|
||||
</tr>
|
||||
@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.</p></td>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_discoveryclient_for_kubernetes"><a class="link" href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></h2>
|
||||
<h2 id="discoveryclient-for-kubernetes"><a class="anchor" href="#discoveryclient-for-kubernetes"></a><a class="link" href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This project provides an implementation of <a href="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java">Discovery Client</a>
|
||||
@@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the <code>sprin
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_native_service_discovery"><a class="link" href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></h2>
|
||||
<h2 id="kubernetes-native-service-discovery"><a class="anchor" href="#kubernetes-native-service-discovery"></a><a class="link" href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">https://istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Additionally, you can use Hystrix for:</p>
|
||||
@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_propertysource_implementations"><a class="link" href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a></h2>
|
||||
<h2 id="kubernetes-propertysource-implementations"><a class="anchor" href="#kubernetes-propertysource-implementations"></a><a class="link" href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The most common approach to configuring your Spring Boot application is to create an <code>application.properties</code> or <code>application.yaml</code> or
|
||||
@@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif
|
||||
variables.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="configmap-propertysource"><a class="link" href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<h3 id="configmap-propertysource"><a class="anchor" href="#configmap-propertysource"></a><a class="link" href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes provides a resource named <a href="https://kubernetes.io/docs/user-guide/configmap/"><code>ConfigMap</code></a> to externalize the
|
||||
parameters to pass to your application in the form of key-value pairs or embedded <code>application.properties</code> or <code>application.yaml</code> 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"</code></pre>
|
||||
spec:
|
||||
containers:
|
||||
- name: container-name
|
||||
image: your-image
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "development"</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_secrets_propertysource"><a class="link" href="#_secrets_propertysource">Secrets PropertySource</a></h3>
|
||||
<h3 id="secrets-propertysource"><a class="anchor" href="#secrets-propertysource"></a><a class="link" href="#secrets-propertysource">5.2. Secrets PropertySource</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes has the notion of <a href="https://kubernetes.io/docs/concepts/configuration/secret/">Secrets</a> for storing
|
||||
sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with <code>Secrets</code> to make secrets
|
||||
@@ -1052,7 +1066,7 @@ the <code>Secret</code> named <code>s1</code> would be looked up in the namespac
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_propertysource_reload"><a class="link" href="#_propertysource_reload"><code>PropertySource</code> Reload</a></h3>
|
||||
<h3 id="propertysource-reload"><a class="anchor" href="#propertysource-reload"></a><a class="link" href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>ConfigMap</code> or
|
||||
@@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_ribbon_discovery_in_kubernetes"><a class="link" href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></h2>
|
||||
<h2 id="ribbon-discovery-in-kubernetes"><a class="anchor" href="#ribbon-discovery-in-kubernetes"></a><a class="link" href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring.cloud.ku
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_ecosystem_awareness"><a class="link" href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a></h2>
|
||||
<h2 id="kubernetes-ecosystem-awareness"><a class="anchor" href="#kubernetes-ecosystem-awareness"></a><a class="link" href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>http</code> protocol to the REST API of the Kubernetes Server.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_kubernetes_profile_autoconfiguration"><a class="link" href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<h3 id="kubernetes-profile-autoconfiguration"><a class="anchor" href="#kubernetes-profile-autoconfiguration"></a><a class="link" href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When the application runs as a pod inside Kubernetes, a Spring profile named <code>kubernetes</code> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_istio_awareness"><a class="link" href="#_istio_awareness">Istio Awareness</a></h3>
|
||||
<h3 id="istio-awareness"><a class="anchor" href="#istio-awareness"></a><a class="link" href="#istio-awareness">7.2. Istio Awareness</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When you include the <code>spring-cloud-kubernetes-istio</code> module in the application classpath, a new profile is added to the application,
|
||||
provided the application is running inside a Kubernetes Cluster with <a href="https://istio.io">Istio</a> installed. You can then use
|
||||
@@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_pod_health_indicator"><a class="link" href="#_pod_health_indicator">Pod Health Indicator</a></h2>
|
||||
<h2 id="pod-health-indicator"><a class="anchor" href="#pod-health-indicator"></a><a class="link" href="#pod-health-indicator">8. Pod Health Indicator</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Boot uses <a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java"><code>HealthIndicator</code></a> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_leader_election"><a class="link" href="#_leader_election">Leader Election</a></h2>
|
||||
<h2 id="leader-election"><a class="anchor" href="#leader-election"></a><a class="link" href="#leader-election">9. Leader Election</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p><TBD></p>
|
||||
@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_security_configurations_inside_kubernetes"><a class="link" href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a></h2>
|
||||
<h2 id="security-configurations-inside-kubernetes"><a class="anchor" href="#security-configurations-inside-kubernetes"></a><a class="link" href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_namespace"><a class="link" href="#_namespace">Namespace</a></h3>
|
||||
<h3 id="namespace"><a class="anchor" href="#namespace"></a><a class="link" href="#namespace">10.1. Namespace</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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:</p>
|
||||
@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_service_account"><a class="link" href="#_service_account">Service Account</a></h3>
|
||||
<h3 id="service-account"><a class="anchor" href="#service-account"></a><a class="link" href="#service-account">10.2. Service Account</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring-cloud-kubernetes</code> 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.</p>
|
||||
@@ -1529,7 +1543,7 @@ roleRef:
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_service_registry_implementation"><a class="link" href="#_service_registry_implementation">Service Registry Implementation</a></h2>
|
||||
<h2 id="service-registry-implementation"><a class="anchor" href="#service-registry-implementation"></a><a class="link" href="#service-registry-implementation">11. Service Registry Implementation</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>In Kubernetes service registration is controlled by the platform, the application itself does not control
|
||||
@@ -1539,7 +1553,7 @@ or setting <code>@EnableDiscoveryClient(autoRegister=false)</code> will have no
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_examples"><a class="link" href="#_examples">Examples</a></h2>
|
||||
<h2 id="examples"><a class="anchor" href="#examples"></a><a class="link" href="#examples">12. Examples</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_other_resources"><a class="link" href="#_other_resources">Other Resources</a></h2>
|
||||
<h2 id="other-resources"><a class="anchor" href="#other-resources"></a><a class="link" href="#other-resources">13. Other Resources</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.</p>
|
||||
@@ -1605,10 +1619,18 @@ The same applies for <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_building"><a class="link" href="#_building">Building</a></h2>
|
||||
<h2 id="configuration-properties"><a class="anchor" href="#configuration-properties"></a><a class="link" href="#configuration-properties">14. Configuration properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To see the list of all Sleuth related configuration properties please check <a href="appendix.html">the Appendix page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="building"><a class="anchor" href="#building"></a><a class="link" href="#building">15. Building</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_basic_compile_and_test"><a class="link" href="#_basic_compile_and_test">Basic Compile and Test</a></h3>
|
||||
<h3 id="basic-compile-and-test"><a class="anchor" href="#basic-compile-and-test"></a><a class="link" href="#basic-compile-and-test">15.1. Basic Compile and Test</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To build the source you will need to install JDK 1.7.</p>
|
||||
</div>
|
||||
@@ -1686,7 +1708,7 @@ If all else fails, build with the command from <code>.travis.yml</code> (usually
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_documentation"><a class="link" href="#_documentation">Documentation</a></h3>
|
||||
<h3 id="documentation"><a class="anchor" href="#documentation"></a><a class="link" href="#documentation">15.2. Documentation</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_working_with_the_code"><a class="link" href="#_working_with_the_code">Working with the code</a></h3>
|
||||
<h3 id="working-with-the-code"><a class="anchor" href="#working-with-the-code"></a><a class="link" href="#working-with-the-code">15.3. Working with the code</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you don’t have an IDE preference we would recommend that you use
|
||||
<a href="https://www.springsource.com/developer/sts">Spring Tools Suite</a> or
|
||||
@@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.</p>
|
||||
should also work without issue as long as they use Maven 3.3.3 or better.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_with_m2eclipse"><a class="link" href="#_importing_into_eclipse_with_m2eclipse">Importing into eclipse with m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-with-m2eclipse"><a class="anchor" href="#importing-into-eclipse-with-m2eclipse"></a><a class="link" href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>We recommend the <a href="https://eclipse.org/m2e/">m2eclipse</a> 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 <code>settings.xml</code>.
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_without_m2eclipse"><a class="link" href="#_importing_into_eclipse_without_m2eclipse">Importing into eclipse without m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-without-m2eclipse"><a class="anchor" href="#importing-into-eclipse-without-m2eclipse"></a><a class="link" href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If you prefer not to use m2eclipse you can generate eclipse project metadata using the
|
||||
following command:</p>
|
||||
@@ -1754,7 +1776,7 @@ from the <code>file</code> menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_contributing"><a class="link" href="#_contributing">Contributing</a></h2>
|
||||
<h2 id="contributing"><a class="anchor" href="#contributing"></a><a class="link" href="#contributing">16. Contributing</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_sign_the_contributor_license_agreement"><a class="link" href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></h3>
|
||||
<h3 id="sign-the-contributor-license-agreement"><a class="anchor" href="#sign-the-contributor-license-agreement"></a><a class="link" href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
<a href="https://cla.pivotal.io/sign/spring">Contributor License Agreement</a>.
|
||||
@@ -1775,7 +1797,7 @@ given the ability to merge pull requests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_of_conduct"><a class="link" href="#_code_of_conduct">Code of Conduct</a></h3>
|
||||
<h3 id="code-of-conduct"><a class="anchor" href="#code-of-conduct"></a><a class="link" href="#code-of-conduct">16.2. Code of Conduct</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>This project adheres to the Contributor Covenant <a href="https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc">code of
|
||||
conduct</a>. By participating, you are expected to uphold this code. Please report
|
||||
@@ -1783,7 +1805,7 @@ unacceptable behavior to <a href="mailto:spring-code-of-conduct@pivotal.io">spri
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_conventions_and_housekeeping"><a class="link" href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></h3>
|
||||
<h3 id="code-conventions-and-housekeeping"><a class="anchor" href="#code-conventions-and-housekeeping"></a><a class="link" href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_checkstyle"><a class="link" href="#_checkstyle">Checkstyle</a></h3>
|
||||
<h3 id="checkstyle"><a class="anchor" href="#checkstyle"></a><a class="link" href="#checkstyle">16.4. Checkstyle</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Build comes with a set of checkstyle rules. You can find them in the <code>spring-cloud-build-tools</code> module. The most notable files under the module are:</p>
|
||||
</div>
|
||||
@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).</p>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_checkstyle_configuration"><a class="link" href="#_checkstyle_configuration">Checkstyle configuration</a></h4>
|
||||
<h4 id="checkstyle-configuration"><a class="anchor" href="#checkstyle-configuration"></a><a class="link" href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Checkstyle rules are <strong>disabled by default</strong>. To add checkstyle to your project just define the following properties and plugins.</p>
|
||||
</div>
|
||||
@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).</p>
|
||||
<div class="content">
|
||||
<pre><?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></pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1954,9 +1976,9 @@ $ touch .springformat</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ide_setup"><a class="link" href="#_ide_setup">IDE setup</a></h3>
|
||||
<h3 id="ide-setup"><a class="anchor" href="#ide-setup"></a><a class="link" href="#ide-setup">16.5. IDE setup</a></h3>
|
||||
<div class="sect3">
|
||||
<h4 id="_intellij_idea"><a class="link" href="#_intellij_idea">Intellij IDEA</a></h4>
|
||||
<h4 id="intellij-idea"><a class="anchor" href="#intellij-idea"></a><a class="link" href="#intellij-idea">16.5.1. Intellij IDEA</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>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 <a href="https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools">Spring Cloud Build</a> project.</p>
|
||||
@@ -2028,15 +2050,15 @@ The following files can be found in the <a href="https://github.com/spring-cloud
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.additional.suppressions.file</code> - this variable corresponds to suppressions in your local project. E.g. you’re working on <code>spring-cloud-contract</code>. Then point to the <code>project-root/src/checkstyle/checkstyle-suppressions.xml</code> folder. Example for <code>spring-cloud-contract</code> would be: <code>/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml</code>.</p>
|
||||
|
||||
473
reference/html/appendix.html
Normal file
473
reference/html/appendix.html
Normal file
@@ -0,0 +1,473 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Asciidoctor 1.5.7.1">
|
||||
<title>Common application properties</title>
|
||||
<link rel="stylesheet" href="css/spring.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
|
||||
<style>
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.switch {
|
||||
border-width: 1px 1px 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.switch--item {
|
||||
padding: 10px;
|
||||
background-color: #ffffff;
|
||||
color: #7a2518;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch--item:not(:first-child) {
|
||||
border-width: 0 0 0 1px;
|
||||
border-style: solid;
|
||||
border-color: #7a2518;
|
||||
}
|
||||
|
||||
.switch--item.selected {
|
||||
background-color: #7a2519;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function addBlockSwitches() {
|
||||
$('.primary').each(function() {
|
||||
primary = $(this);
|
||||
createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected");
|
||||
primary.children('.title').remove();
|
||||
});
|
||||
$('.secondary').each(function(idx, node) {
|
||||
secondary = $(node);
|
||||
primary = findPrimary(secondary);
|
||||
switchItem = createSwitchItem(secondary, primary.children('.switch'));
|
||||
switchItem.content.addClass('hidden');
|
||||
findPrimary(secondary).append(switchItem.content);
|
||||
secondary.remove();
|
||||
});
|
||||
}
|
||||
|
||||
function createBlockSwitch(primary) {
|
||||
blockSwitch = $('<div class="switch"></div>');
|
||||
primary.prepend(blockSwitch);
|
||||
return blockSwitch;
|
||||
}
|
||||
|
||||
function findPrimary(secondary) {
|
||||
candidate = secondary.prev();
|
||||
while (!candidate.is('.primary')) {
|
||||
candidate = candidate.prev();
|
||||
}
|
||||
return candidate;
|
||||
}
|
||||
|
||||
function createSwitchItem(block, blockSwitch) {
|
||||
blockName = block.children('.title').text();
|
||||
content = block.children('.content').first().append(block.next('.colist'));
|
||||
item = $('<div class="switch--item">' + blockName + '</div>');
|
||||
item.on('click', '', content, function(e) {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
e.data.siblings('.content').addClass('hidden');
|
||||
e.data.removeClass('hidden');
|
||||
});
|
||||
blockSwitch.append(item);
|
||||
return {'item': item, 'content': content};
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#common-application-properties">Appendix A: Common application properties</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div class="sect1">
|
||||
<h2 id="common-application-properties"><a class="link" href="#common-application-properties">Appendix A: Common application properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Various properties can be specified inside your <code>application.properties</code> file, inside your <code>application.yml</code> 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.</p>
|
||||
</div>
|
||||
<div class="admonitionblock note">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-note" title="Note"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
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.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table class="tableblock frame-all grid-all stretch">
|
||||
<colgroup>
|
||||
<col style="width: 33.3333%;">
|
||||
<col style="width: 33.3333%;">
|
||||
<col style="width: 33.3334%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="tableblock halign-left valign-top">Name</th>
|
||||
<th class="tableblock halign-left valign-top">Default</th>
|
||||
<th class="tableblock halign-left valign-top">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.api-version</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.apiVersion</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">v1</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API Version</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.ca-cert-data</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.ca-cert-file</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.caCertData</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API CACertData</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.caCertFile</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API CACertFile</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-cert-data</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-cert-file</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-key-algo</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-key-data</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-key-file</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.client-key-passphrase</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientCertData</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientCertData</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientCertFile</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientCertFile</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientKeyAlgo</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">RSA</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientKeyAlgo</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientKeyData</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientKeyData</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientKeyFile</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientKeyFile</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.clientKeyPassphrase</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">changeit</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API ClientKeyPassphrase</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.connection-timeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.connectionTimeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">10s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Connection timeout</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.http-proxy</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.https-proxy</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.logging-interval</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.loggingInterval</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">20s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Logging interval</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.master-url</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.masterUrl</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="https://kubernetes.default.svc" class="bare">kubernetes.default.svc</a></p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API Master Node URL</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.namespace</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes Namespace</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.no-proxy</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.password</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API Password</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.proxy-password</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.proxy-username</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.request-timeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.requestTimeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">10s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Request timeout</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.rolling-timeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.rollingTimeout</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">900s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Rolling timeout</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.trust-certs</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.trustCerts</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API Trust Certificates</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.username</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Kubernetes API Username</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.watch-reconnect-interval</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.watch-reconnect-limit</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.watchReconnectInterval</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">1s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Reconnect Interval</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.client.watchReconnectLimit</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">-1</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Reconnect Interval limit retries</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.enable-api</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable the ConfigMap property source locator.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.name</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.namespace</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.paths</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.config.sources</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Enables the Kubernetes configuration reload on change.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.max-wait-for-restart</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">2s</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">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</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.mode</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Sets the detection mode for Kubernetes configuration reload.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.monitoring-config-maps</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Enables monitoring on config maps to detect changes.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.monitoring-secrets</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Enables monitoring on secrets to detect changes.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.period</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">15000ms</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Sets the polling period to use when the detection mode is POLLING.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.reload.strategy</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Sets the reload strategy for Kubernetes configuration reload on change.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.ribbon.cluster-domain</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">cluster.local</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">cluster domain.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.ribbon.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Ribbon enabled,default true.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.ribbon.mode</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">{@link KubernetesRibbonMode} setting ribbon server list with ip of pod or service name. default value is POD.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.enable-api</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.enabled</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">true</p></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Enable the Secrets property source locator.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.labels</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.name</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.namespace</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.paths</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">spring.cloud.kubernetes.secrets.sources</p></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
<td class="tableblock halign-left valign-top"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/tocbot/tocbot.min.js"></script>
|
||||
<script type="text/javascript" src="js/toc.js"></script>
|
||||
<link rel="stylesheet" href="js/highlight/styles/atom-one-dark-reasonable.min.css">
|
||||
<script src="js/highlight/highlight.min.js"></script>
|
||||
<script>hljs.initHighlighting()</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -96,49 +96,63 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#_starters">Starters</a></li>
|
||||
<li><a href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></li>
|
||||
<li><a href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a>
|
||||
<li><a href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#starters">2. Starters</a></li>
|
||||
<li><a href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></li>
|
||||
<li><a href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#_secrets_propertysource">Secrets PropertySource</a></li>
|
||||
<li><a href="#_propertysource_reload"><code>PropertySource</code> Reload</a></li>
|
||||
<li><a href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#secrets-propertysource">5.2. Secrets PropertySource</a></li>
|
||||
<li><a href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a>
|
||||
<li><a href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#_istio_awareness">Istio Awareness</a></li>
|
||||
<li><a href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#istio-awareness">7.2. Istio Awareness</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_pod_health_indicator">Pod Health Indicator</a></li>
|
||||
<li><a href="#_leader_election">Leader Election</a></li>
|
||||
<li><a href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a>
|
||||
<li><a href="#pod-health-indicator">8. Pod Health Indicator</a></li>
|
||||
<li><a href="#leader-election">9. Leader Election</a></li>
|
||||
<li><a href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_namespace">Namespace</a></li>
|
||||
<li><a href="#_service_account">Service Account</a></li>
|
||||
<li><a href="#namespace">10.1. Namespace</a></li>
|
||||
<li><a href="#service-account">10.2. Service Account</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_service_registry_implementation">Service Registry Implementation</a></li>
|
||||
<li><a href="#_examples">Examples</a></li>
|
||||
<li><a href="#_other_resources">Other Resources</a></li>
|
||||
<li><a href="#_building">Building</a>
|
||||
<li><a href="#service-registry-implementation">11. Service Registry Implementation</a></li>
|
||||
<li><a href="#examples">12. Examples</a></li>
|
||||
<li><a href="#other-resources">13. Other Resources</a></li>
|
||||
<li><a href="#configuration-properties">14. Configuration properties</a></li>
|
||||
<li><a href="#building">15. Building</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_basic_compile_and_test">Basic Compile and Test</a></li>
|
||||
<li><a href="#_documentation">Documentation</a></li>
|
||||
<li><a href="#_working_with_the_code">Working with the code</a></li>
|
||||
<li><a href="#basic-compile-and-test">15.1. Basic Compile and Test</a></li>
|
||||
<li><a href="#documentation">15.2. Documentation</a></li>
|
||||
<li><a href="#working-with-the-code">15.3. Working with the code</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></li>
|
||||
<li><a href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_contributing">Contributing</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#contributing">16. Contributing</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#_code_of_conduct">Code of Conduct</a></li>
|
||||
<li><a href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#_checkstyle">Checkstyle</a></li>
|
||||
<li><a href="#_ide_setup">IDE setup</a></li>
|
||||
<li><a href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#code-of-conduct">16.2. Code of Conduct</a></li>
|
||||
<li><a href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#checkstyle">16.4. Checkstyle</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#ide-setup">16.5. IDE setup</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#intellij-idea">16.5.1. Intellij IDEA</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -153,7 +167,7 @@ $(addBlockSwitches);
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_why_do_you_need_spring_cloud_kubernetes"><a class="link" href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<h2 id="why-do-you-need-spring-cloud-kubernetes"><a class="anchor" href="#why-do-you-need-spring-cloud-kubernetes"></a><a class="link" href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_starters"><a class="link" href="#_starters">Starters</a></h2>
|
||||
<h2 id="starters"><a class="anchor" href="#starters"></a><a class="link" href="#starters">2. Starters</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Starters are convenient dependency descriptors you can include in your
|
||||
@@ -190,7 +204,7 @@ auto-configuration for a feature set.</p>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_discoveryclient_for_kubernetes">Discovery Client</a> implementation that
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#discoveryclient-for-kubernetes">Discovery Client</a> implementation that
|
||||
resolves service names to Kubernetes Services.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.</p></td>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Load application properties from Kubernetes
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#_secrets_propertysource">Secrets</a>.
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#secrets-propertysource">Secrets</a>.
|
||||
<a href="#PropertySource Reload">Reload</a> application properties when a ConfigMap or
|
||||
Secret changes.</p></td>
|
||||
</tr>
|
||||
@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.</p></td>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_discoveryclient_for_kubernetes"><a class="link" href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></h2>
|
||||
<h2 id="discoveryclient-for-kubernetes"><a class="anchor" href="#discoveryclient-for-kubernetes"></a><a class="link" href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This project provides an implementation of <a href="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java">Discovery Client</a>
|
||||
@@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the <code>sprin
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_native_service_discovery"><a class="link" href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></h2>
|
||||
<h2 id="kubernetes-native-service-discovery"><a class="anchor" href="#kubernetes-native-service-discovery"></a><a class="link" href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">https://istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Additionally, you can use Hystrix for:</p>
|
||||
@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_propertysource_implementations"><a class="link" href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a></h2>
|
||||
<h2 id="kubernetes-propertysource-implementations"><a class="anchor" href="#kubernetes-propertysource-implementations"></a><a class="link" href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The most common approach to configuring your Spring Boot application is to create an <code>application.properties</code> or <code>application.yaml</code> or
|
||||
@@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif
|
||||
variables.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="configmap-propertysource"><a class="link" href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<h3 id="configmap-propertysource"><a class="anchor" href="#configmap-propertysource"></a><a class="link" href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes provides a resource named <a href="https://kubernetes.io/docs/user-guide/configmap/"><code>ConfigMap</code></a> to externalize the
|
||||
parameters to pass to your application in the form of key-value pairs or embedded <code>application.properties</code> or <code>application.yaml</code> 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"</code></pre>
|
||||
spec:
|
||||
containers:
|
||||
- name: container-name
|
||||
image: your-image
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "development"</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_secrets_propertysource"><a class="link" href="#_secrets_propertysource">Secrets PropertySource</a></h3>
|
||||
<h3 id="secrets-propertysource"><a class="anchor" href="#secrets-propertysource"></a><a class="link" href="#secrets-propertysource">5.2. Secrets PropertySource</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes has the notion of <a href="https://kubernetes.io/docs/concepts/configuration/secret/">Secrets</a> for storing
|
||||
sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with <code>Secrets</code> to make secrets
|
||||
@@ -1052,7 +1066,7 @@ the <code>Secret</code> named <code>s1</code> would be looked up in the namespac
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_propertysource_reload"><a class="link" href="#_propertysource_reload"><code>PropertySource</code> Reload</a></h3>
|
||||
<h3 id="propertysource-reload"><a class="anchor" href="#propertysource-reload"></a><a class="link" href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>ConfigMap</code> or
|
||||
@@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_ribbon_discovery_in_kubernetes"><a class="link" href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></h2>
|
||||
<h2 id="ribbon-discovery-in-kubernetes"><a class="anchor" href="#ribbon-discovery-in-kubernetes"></a><a class="link" href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring.cloud.ku
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_ecosystem_awareness"><a class="link" href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a></h2>
|
||||
<h2 id="kubernetes-ecosystem-awareness"><a class="anchor" href="#kubernetes-ecosystem-awareness"></a><a class="link" href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>http</code> protocol to the REST API of the Kubernetes Server.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_kubernetes_profile_autoconfiguration"><a class="link" href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<h3 id="kubernetes-profile-autoconfiguration"><a class="anchor" href="#kubernetes-profile-autoconfiguration"></a><a class="link" href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When the application runs as a pod inside Kubernetes, a Spring profile named <code>kubernetes</code> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_istio_awareness"><a class="link" href="#_istio_awareness">Istio Awareness</a></h3>
|
||||
<h3 id="istio-awareness"><a class="anchor" href="#istio-awareness"></a><a class="link" href="#istio-awareness">7.2. Istio Awareness</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When you include the <code>spring-cloud-kubernetes-istio</code> module in the application classpath, a new profile is added to the application,
|
||||
provided the application is running inside a Kubernetes Cluster with <a href="https://istio.io">Istio</a> installed. You can then use
|
||||
@@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_pod_health_indicator"><a class="link" href="#_pod_health_indicator">Pod Health Indicator</a></h2>
|
||||
<h2 id="pod-health-indicator"><a class="anchor" href="#pod-health-indicator"></a><a class="link" href="#pod-health-indicator">8. Pod Health Indicator</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Boot uses <a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java"><code>HealthIndicator</code></a> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_leader_election"><a class="link" href="#_leader_election">Leader Election</a></h2>
|
||||
<h2 id="leader-election"><a class="anchor" href="#leader-election"></a><a class="link" href="#leader-election">9. Leader Election</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p><TBD></p>
|
||||
@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_security_configurations_inside_kubernetes"><a class="link" href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a></h2>
|
||||
<h2 id="security-configurations-inside-kubernetes"><a class="anchor" href="#security-configurations-inside-kubernetes"></a><a class="link" href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_namespace"><a class="link" href="#_namespace">Namespace</a></h3>
|
||||
<h3 id="namespace"><a class="anchor" href="#namespace"></a><a class="link" href="#namespace">10.1. Namespace</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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:</p>
|
||||
@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_service_account"><a class="link" href="#_service_account">Service Account</a></h3>
|
||||
<h3 id="service-account"><a class="anchor" href="#service-account"></a><a class="link" href="#service-account">10.2. Service Account</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring-cloud-kubernetes</code> 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.</p>
|
||||
@@ -1529,7 +1543,7 @@ roleRef:
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_service_registry_implementation"><a class="link" href="#_service_registry_implementation">Service Registry Implementation</a></h2>
|
||||
<h2 id="service-registry-implementation"><a class="anchor" href="#service-registry-implementation"></a><a class="link" href="#service-registry-implementation">11. Service Registry Implementation</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>In Kubernetes service registration is controlled by the platform, the application itself does not control
|
||||
@@ -1539,7 +1553,7 @@ or setting <code>@EnableDiscoveryClient(autoRegister=false)</code> will have no
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_examples"><a class="link" href="#_examples">Examples</a></h2>
|
||||
<h2 id="examples"><a class="anchor" href="#examples"></a><a class="link" href="#examples">12. Examples</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_other_resources"><a class="link" href="#_other_resources">Other Resources</a></h2>
|
||||
<h2 id="other-resources"><a class="anchor" href="#other-resources"></a><a class="link" href="#other-resources">13. Other Resources</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.</p>
|
||||
@@ -1605,10 +1619,18 @@ The same applies for <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_building"><a class="link" href="#_building">Building</a></h2>
|
||||
<h2 id="configuration-properties"><a class="anchor" href="#configuration-properties"></a><a class="link" href="#configuration-properties">14. Configuration properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To see the list of all Sleuth related configuration properties please check <a href="appendix.html">the Appendix page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="building"><a class="anchor" href="#building"></a><a class="link" href="#building">15. Building</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_basic_compile_and_test"><a class="link" href="#_basic_compile_and_test">Basic Compile and Test</a></h3>
|
||||
<h3 id="basic-compile-and-test"><a class="anchor" href="#basic-compile-and-test"></a><a class="link" href="#basic-compile-and-test">15.1. Basic Compile and Test</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To build the source you will need to install JDK 1.7.</p>
|
||||
</div>
|
||||
@@ -1686,7 +1708,7 @@ If all else fails, build with the command from <code>.travis.yml</code> (usually
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_documentation"><a class="link" href="#_documentation">Documentation</a></h3>
|
||||
<h3 id="documentation"><a class="anchor" href="#documentation"></a><a class="link" href="#documentation">15.2. Documentation</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_working_with_the_code"><a class="link" href="#_working_with_the_code">Working with the code</a></h3>
|
||||
<h3 id="working-with-the-code"><a class="anchor" href="#working-with-the-code"></a><a class="link" href="#working-with-the-code">15.3. Working with the code</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you don’t have an IDE preference we would recommend that you use
|
||||
<a href="https://www.springsource.com/developer/sts">Spring Tools Suite</a> or
|
||||
@@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.</p>
|
||||
should also work without issue as long as they use Maven 3.3.3 or better.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_with_m2eclipse"><a class="link" href="#_importing_into_eclipse_with_m2eclipse">Importing into eclipse with m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-with-m2eclipse"><a class="anchor" href="#importing-into-eclipse-with-m2eclipse"></a><a class="link" href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>We recommend the <a href="https://eclipse.org/m2e/">m2eclipse</a> 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 <code>settings.xml</code>.
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_without_m2eclipse"><a class="link" href="#_importing_into_eclipse_without_m2eclipse">Importing into eclipse without m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-without-m2eclipse"><a class="anchor" href="#importing-into-eclipse-without-m2eclipse"></a><a class="link" href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If you prefer not to use m2eclipse you can generate eclipse project metadata using the
|
||||
following command:</p>
|
||||
@@ -1754,7 +1776,7 @@ from the <code>file</code> menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_contributing"><a class="link" href="#_contributing">Contributing</a></h2>
|
||||
<h2 id="contributing"><a class="anchor" href="#contributing"></a><a class="link" href="#contributing">16. Contributing</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_sign_the_contributor_license_agreement"><a class="link" href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></h3>
|
||||
<h3 id="sign-the-contributor-license-agreement"><a class="anchor" href="#sign-the-contributor-license-agreement"></a><a class="link" href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
<a href="https://cla.pivotal.io/sign/spring">Contributor License Agreement</a>.
|
||||
@@ -1775,7 +1797,7 @@ given the ability to merge pull requests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_of_conduct"><a class="link" href="#_code_of_conduct">Code of Conduct</a></h3>
|
||||
<h3 id="code-of-conduct"><a class="anchor" href="#code-of-conduct"></a><a class="link" href="#code-of-conduct">16.2. Code of Conduct</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>This project adheres to the Contributor Covenant <a href="https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc">code of
|
||||
conduct</a>. By participating, you are expected to uphold this code. Please report
|
||||
@@ -1783,7 +1805,7 @@ unacceptable behavior to <a href="mailto:spring-code-of-conduct@pivotal.io">spri
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_conventions_and_housekeeping"><a class="link" href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></h3>
|
||||
<h3 id="code-conventions-and-housekeeping"><a class="anchor" href="#code-conventions-and-housekeeping"></a><a class="link" href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_checkstyle"><a class="link" href="#_checkstyle">Checkstyle</a></h3>
|
||||
<h3 id="checkstyle"><a class="anchor" href="#checkstyle"></a><a class="link" href="#checkstyle">16.4. Checkstyle</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Build comes with a set of checkstyle rules. You can find them in the <code>spring-cloud-build-tools</code> module. The most notable files under the module are:</p>
|
||||
</div>
|
||||
@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).</p>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_checkstyle_configuration"><a class="link" href="#_checkstyle_configuration">Checkstyle configuration</a></h4>
|
||||
<h4 id="checkstyle-configuration"><a class="anchor" href="#checkstyle-configuration"></a><a class="link" href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Checkstyle rules are <strong>disabled by default</strong>. To add checkstyle to your project just define the following properties and plugins.</p>
|
||||
</div>
|
||||
@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).</p>
|
||||
<div class="content">
|
||||
<pre><?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></pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1954,9 +1976,9 @@ $ touch .springformat</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ide_setup"><a class="link" href="#_ide_setup">IDE setup</a></h3>
|
||||
<h3 id="ide-setup"><a class="anchor" href="#ide-setup"></a><a class="link" href="#ide-setup">16.5. IDE setup</a></h3>
|
||||
<div class="sect3">
|
||||
<h4 id="_intellij_idea"><a class="link" href="#_intellij_idea">Intellij IDEA</a></h4>
|
||||
<h4 id="intellij-idea"><a class="anchor" href="#intellij-idea"></a><a class="link" href="#intellij-idea">16.5.1. Intellij IDEA</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>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 <a href="https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools">Spring Cloud Build</a> project.</p>
|
||||
@@ -2028,15 +2050,15 @@ The following files can be found in the <a href="https://github.com/spring-cloud
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.additional.suppressions.file</code> - this variable corresponds to suppressions in your local project. E.g. you’re working on <code>spring-cloud-contract</code>. Then point to the <code>project-root/src/checkstyle/checkstyle-suppressions.xml</code> folder. Example for <code>spring-cloud-contract</code> would be: <code>/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml</code>.</p>
|
||||
|
||||
@@ -96,49 +96,63 @@ $(addBlockSwitches);
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#_starters">Starters</a></li>
|
||||
<li><a href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></li>
|
||||
<li><a href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a>
|
||||
<li><a href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></li>
|
||||
<li><a href="#starters">2. Starters</a></li>
|
||||
<li><a href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></li>
|
||||
<li><a href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#_secrets_propertysource">Secrets PropertySource</a></li>
|
||||
<li><a href="#_propertysource_reload"><code>PropertySource</code> Reload</a></li>
|
||||
<li><a href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></li>
|
||||
<li><a href="#secrets-propertysource">5.2. Secrets PropertySource</a></li>
|
||||
<li><a href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a>
|
||||
<li><a href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></li>
|
||||
<li><a href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#_istio_awareness">Istio Awareness</a></li>
|
||||
<li><a href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></li>
|
||||
<li><a href="#istio-awareness">7.2. Istio Awareness</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_pod_health_indicator">Pod Health Indicator</a></li>
|
||||
<li><a href="#_leader_election">Leader Election</a></li>
|
||||
<li><a href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a>
|
||||
<li><a href="#pod-health-indicator">8. Pod Health Indicator</a></li>
|
||||
<li><a href="#leader-election">9. Leader Election</a></li>
|
||||
<li><a href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_namespace">Namespace</a></li>
|
||||
<li><a href="#_service_account">Service Account</a></li>
|
||||
<li><a href="#namespace">10.1. Namespace</a></li>
|
||||
<li><a href="#service-account">10.2. Service Account</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_service_registry_implementation">Service Registry Implementation</a></li>
|
||||
<li><a href="#_examples">Examples</a></li>
|
||||
<li><a href="#_other_resources">Other Resources</a></li>
|
||||
<li><a href="#_building">Building</a>
|
||||
<li><a href="#service-registry-implementation">11. Service Registry Implementation</a></li>
|
||||
<li><a href="#examples">12. Examples</a></li>
|
||||
<li><a href="#other-resources">13. Other Resources</a></li>
|
||||
<li><a href="#configuration-properties">14. Configuration properties</a></li>
|
||||
<li><a href="#building">15. Building</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_basic_compile_and_test">Basic Compile and Test</a></li>
|
||||
<li><a href="#_documentation">Documentation</a></li>
|
||||
<li><a href="#_working_with_the_code">Working with the code</a></li>
|
||||
<li><a href="#basic-compile-and-test">15.1. Basic Compile and Test</a></li>
|
||||
<li><a href="#documentation">15.2. Documentation</a></li>
|
||||
<li><a href="#working-with-the-code">15.3. Working with the code</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></li>
|
||||
<li><a href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_contributing">Contributing</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#contributing">16. Contributing</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#_code_of_conduct">Code of Conduct</a></li>
|
||||
<li><a href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#_checkstyle">Checkstyle</a></li>
|
||||
<li><a href="#_ide_setup">IDE setup</a></li>
|
||||
<li><a href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></li>
|
||||
<li><a href="#code-of-conduct">16.2. Code of Conduct</a></li>
|
||||
<li><a href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></li>
|
||||
<li><a href="#checkstyle">16.4. Checkstyle</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#ide-setup">16.5. IDE setup</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#intellij-idea">16.5.1. Intellij IDEA</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -153,7 +167,7 @@ $(addBlockSwitches);
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_why_do_you_need_spring_cloud_kubernetes"><a class="link" href="#_why_do_you_need_spring_cloud_kubernetes">Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<h2 id="why-do-you-need-spring-cloud-kubernetes"><a class="anchor" href="#why-do-you-need-spring-cloud-kubernetes"></a><a class="link" href="#why-do-you-need-spring-cloud-kubernetes">1. Why do you need Spring Cloud Kubernetes?</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_starters"><a class="link" href="#_starters">Starters</a></h2>
|
||||
<h2 id="starters"><a class="anchor" href="#starters"></a><a class="link" href="#starters">2. Starters</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Starters are convenient dependency descriptors you can include in your
|
||||
@@ -190,7 +204,7 @@ auto-configuration for a feature set.</p>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_discoveryclient_for_kubernetes">Discovery Client</a> implementation that
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#discoveryclient-for-kubernetes">Discovery Client</a> implementation that
|
||||
resolves service names to Kubernetes Services.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -203,7 +217,7 @@ resolves service names to Kubernetes Services.</p></td>
|
||||
</div>
|
||||
</div></div></td>
|
||||
<td class="tableblock halign-left valign-top"><p class="tableblock">Load application properties from Kubernetes
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#_secrets_propertysource">Secrets</a>.
|
||||
<a href="#ConfigMap PropertySource">ConfigMaps</a> and <a href="#secrets-propertysource">Secrets</a>.
|
||||
<a href="#PropertySource Reload">Reload</a> application properties when a ConfigMap or
|
||||
Secret changes.</p></td>
|
||||
</tr>
|
||||
@@ -235,7 +249,7 @@ server list obtained from Kubernetes Endpoints.</p></td>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_discoveryclient_for_kubernetes"><a class="link" href="#_discoveryclient_for_kubernetes">DiscoveryClient for Kubernetes</a></h2>
|
||||
<h2 id="discoveryclient-for-kubernetes"><a class="anchor" href="#discoveryclient-for-kubernetes"></a><a class="link" href="#discoveryclient-for-kubernetes">3. DiscoveryClient for Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This project provides an implementation of <a href="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-commons/src/main/java/org/springframework/cloud/client/discovery/DiscoveryClient.java">Discovery Client</a>
|
||||
@@ -339,14 +353,14 @@ this to work, you need to align the Kubernetes service name with the <code>sprin
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_native_service_discovery"><a class="link" href="#_kubernetes_native_service_discovery">Kubernetes native service discovery</a></h2>
|
||||
<h2 id="kubernetes-native-service-discovery"><a class="anchor" href="#kubernetes-native-service-discovery"></a><a class="link" href="#kubernetes-native-service-discovery">4. Kubernetes native service discovery</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">https://istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
<p>Kubernetes itself is capable of (server side) service discovery (see: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#discovering-services" class="bare">kubernetes.io/docs/concepts/services-networking/service/#discovering-services</a>).
|
||||
Using native kubernetes service discovery ensures compatibility with additional tooling, such as Istio (<a href="https://istio.io" class="bare">istio.io</a>), a service mesh that is capable of load balancing, ribbon, circuit breaker, failover, and much more.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
<p>The caller service then need only refer to names resolvable in a particular Kubernetes cluster. A simple implementation might use a spring <code>RestTemplate</code> that refers to a fully qualified domain name (FQDN), such as <code><a href="https://{service-name}.{namespace}.svc.{cluster}.local:{service-port}" class="bare">{service-name}.{namespace}.svc.{cluster}.local:{service-port}</a></code>.</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Additionally, you can use Hystrix for:</p>
|
||||
@@ -364,7 +378,7 @@ Using native kubernetes service discovery ensures compatibility with additional
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_propertysource_implementations"><a class="link" href="#_kubernetes_propertysource_implementations">Kubernetes PropertySource implementations</a></h2>
|
||||
<h2 id="kubernetes-propertysource-implementations"><a class="anchor" href="#kubernetes-propertysource-implementations"></a><a class="link" href="#kubernetes-propertysource-implementations">5. Kubernetes PropertySource implementations</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>The most common approach to configuring your Spring Boot application is to create an <code>application.properties</code> or <code>application.yaml</code> or
|
||||
@@ -373,7 +387,7 @@ application or Spring Boot starters. You can override these properties by specif
|
||||
variables.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="configmap-propertysource"><a class="link" href="#configmap-propertysource">Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<h3 id="configmap-propertysource"><a class="anchor" href="#configmap-propertysource"></a><a class="link" href="#configmap-propertysource">5.1. Using a <code>ConfigMap</code> <code>PropertySource</code></a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes provides a resource named <a href="https://kubernetes.io/docs/user-guide/configmap/"><code>ConfigMap</code></a> to externalize the
|
||||
parameters to pass to your application in the form of key-value pairs or embedded <code>application.properties</code> or <code>application.yaml</code> 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"</code></pre>
|
||||
spec:
|
||||
containers:
|
||||
- name: container-name
|
||||
image: your-image
|
||||
env:
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: "development"</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -776,7 +790,7 @@ You have to provide the full exact path to each property file, because directori
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_secrets_propertysource"><a class="link" href="#_secrets_propertysource">Secrets PropertySource</a></h3>
|
||||
<h3 id="secrets-propertysource"><a class="anchor" href="#secrets-propertysource"></a><a class="link" href="#secrets-propertysource">5.2. Secrets PropertySource</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Kubernetes has the notion of <a href="https://kubernetes.io/docs/concepts/configuration/secret/">Secrets</a> for storing
|
||||
sensitive data such as passwords, OAuth tokens, and so on. This project provides integration with <code>Secrets</code> to make secrets
|
||||
@@ -1052,7 +1066,7 @@ the <code>Secret</code> named <code>s1</code> would be looked up in the namespac
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_propertysource_reload"><a class="link" href="#_propertysource_reload"><code>PropertySource</code> Reload</a></h3>
|
||||
<h3 id="propertysource-reload"><a class="anchor" href="#propertysource-reload"></a><a class="link" href="#propertysource-reload">5.3. <code>PropertySource</code> Reload</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>ConfigMap</code> or
|
||||
@@ -1216,7 +1230,7 @@ This means, for example, that using polling on file-mounted secret sources does
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_ribbon_discovery_in_kubernetes"><a class="link" href="#_ribbon_discovery_in_kubernetes">Ribbon Discovery in Kubernetes</a></h2>
|
||||
<h2 id="ribbon-discovery-in-kubernetes"><a class="anchor" href="#ribbon-discovery-in-kubernetes"></a><a class="link" href="#ribbon-discovery-in-kubernetes">6. Ribbon Discovery in Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring.cloud.ku
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_kubernetes_ecosystem_awareness"><a class="link" href="#_kubernetes_ecosystem_awareness">Kubernetes Ecosystem Awareness</a></h2>
|
||||
<h2 id="kubernetes-ecosystem-awareness"><a class="anchor" href="#kubernetes-ecosystem-awareness"></a><a class="link" href="#kubernetes-ecosystem-awareness">7. Kubernetes Ecosystem Awareness</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>http</code> protocol to the REST API of the Kubernetes Server.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_kubernetes_profile_autoconfiguration"><a class="link" href="#_kubernetes_profile_autoconfiguration">Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<h3 id="kubernetes-profile-autoconfiguration"><a class="anchor" href="#kubernetes-profile-autoconfiguration"></a><a class="link" href="#kubernetes-profile-autoconfiguration">7.1. Kubernetes Profile Autoconfiguration</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When the application runs as a pod inside Kubernetes, a Spring profile named <code>kubernetes</code> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_istio_awareness"><a class="link" href="#_istio_awareness">Istio Awareness</a></h3>
|
||||
<h3 id="istio-awareness"><a class="anchor" href="#istio-awareness"></a><a class="link" href="#istio-awareness">7.2. Istio Awareness</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>When you include the <code>spring-cloud-kubernetes-istio</code> module in the application classpath, a new profile is added to the application,
|
||||
provided the application is running inside a Kubernetes Cluster with <a href="https://istio.io">Istio</a> installed. You can then use
|
||||
@@ -1398,7 +1412,7 @@ making it easy for our Spring Boot applications to consume this data to dynamica
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_pod_health_indicator"><a class="link" href="#_pod_health_indicator">Pod Health Indicator</a></h2>
|
||||
<h2 id="pod-health-indicator"><a class="anchor" href="#pod-health-indicator"></a><a class="link" href="#pod-health-indicator">8. Pod Health Indicator</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Spring Boot uses <a href="https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java"><code>HealthIndicator</code></a> 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
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_leader_election"><a class="link" href="#_leader_election">Leader Election</a></h2>
|
||||
<h2 id="leader-election"><a class="anchor" href="#leader-election"></a><a class="link" href="#leader-election">9. Leader Election</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p><TBD></p>
|
||||
@@ -1428,10 +1442,10 @@ That makes it really useful for exposing health-related information to the user
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_security_configurations_inside_kubernetes"><a class="link" href="#_security_configurations_inside_kubernetes">Security Configurations Inside Kubernetes</a></h2>
|
||||
<h2 id="security-configurations-inside-kubernetes"><a class="anchor" href="#security-configurations-inside-kubernetes"></a><a class="link" href="#security-configurations-inside-kubernetes">10. Security Configurations Inside Kubernetes</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_namespace"><a class="link" href="#_namespace">Namespace</a></h3>
|
||||
<h3 id="namespace"><a class="anchor" href="#namespace"></a><a class="link" href="#namespace">10.1. Namespace</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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:</p>
|
||||
@@ -1451,7 +1465,7 @@ For earlier versions, it needs to be specified as an environment variable to the
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_service_account"><a class="link" href="#_service_account">Service Account</a></h3>
|
||||
<h3 id="service-account"><a class="anchor" href="#service-account"></a><a class="link" href="#service-account">10.2. Service Account</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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 <code>spring-cloud-kubernetes</code> 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.</p>
|
||||
@@ -1529,7 +1543,7 @@ roleRef:
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_service_registry_implementation"><a class="link" href="#_service_registry_implementation">Service Registry Implementation</a></h2>
|
||||
<h2 id="service-registry-implementation"><a class="anchor" href="#service-registry-implementation"></a><a class="link" href="#service-registry-implementation">11. Service Registry Implementation</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>In Kubernetes service registration is controlled by the platform, the application itself does not control
|
||||
@@ -1539,7 +1553,7 @@ or setting <code>@EnableDiscoveryClient(autoRegister=false)</code> will have no
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_examples"><a class="link" href="#_examples">Examples</a></h2>
|
||||
<h2 id="examples"><a class="anchor" href="#examples"></a><a class="link" href="#examples">12. Examples</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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 <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_other_resources"><a class="link" href="#_other_resources">Other Resources</a></h2>
|
||||
<h2 id="other-resources"><a class="anchor" href="#other-resources"></a><a class="link" href="#other-resources">13. Other Resources</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>This section lists other resources, such as presentations (slides) and videos about Spring Cloud Kubernetes.</p>
|
||||
@@ -1605,10 +1619,18 @@ The same applies for <code>PropertySourceLocator</code>, where you need to add t
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_building"><a class="link" href="#_building">Building</a></h2>
|
||||
<h2 id="configuration-properties"><a class="anchor" href="#configuration-properties"></a><a class="link" href="#configuration-properties">14. Configuration properties</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>To see the list of all Sleuth related configuration properties please check <a href="appendix.html">the Appendix page</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="building"><a class="anchor" href="#building"></a><a class="link" href="#building">15. Building</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="sect2">
|
||||
<h3 id="_basic_compile_and_test"><a class="link" href="#_basic_compile_and_test">Basic Compile and Test</a></h3>
|
||||
<h3 id="basic-compile-and-test"><a class="anchor" href="#basic-compile-and-test"></a><a class="link" href="#basic-compile-and-test">15.1. Basic Compile and Test</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To build the source you will need to install JDK 1.7.</p>
|
||||
</div>
|
||||
@@ -1686,7 +1708,7 @@ If all else fails, build with the command from <code>.travis.yml</code> (usually
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_documentation"><a class="link" href="#_documentation">Documentation</a></h3>
|
||||
<h3 id="documentation"><a class="anchor" href="#documentation"></a><a class="link" href="#documentation">15.2. Documentation</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_working_with_the_code"><a class="link" href="#_working_with_the_code">Working with the code</a></h3>
|
||||
<h3 id="working-with-the-code"><a class="anchor" href="#working-with-the-code"></a><a class="link" href="#working-with-the-code">15.3. Working with the code</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>If you don’t have an IDE preference we would recommend that you use
|
||||
<a href="https://www.springsource.com/developer/sts">Spring Tools Suite</a> or
|
||||
@@ -1708,7 +1730,7 @@ a modified file in the correct place. Just commit it and push the change.</p>
|
||||
should also work without issue as long as they use Maven 3.3.3 or better.</p>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_with_m2eclipse"><a class="link" href="#_importing_into_eclipse_with_m2eclipse">Importing into eclipse with m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-with-m2eclipse"><a class="anchor" href="#importing-into-eclipse-with-m2eclipse"></a><a class="link" href="#importing-into-eclipse-with-m2eclipse">15.3.1. Importing into eclipse with m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>We recommend the <a href="https://eclipse.org/m2e/">m2eclipse</a> 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 <code>settings.xml</code>.
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_importing_into_eclipse_without_m2eclipse"><a class="link" href="#_importing_into_eclipse_without_m2eclipse">Importing into eclipse without m2eclipse</a></h4>
|
||||
<h4 id="importing-into-eclipse-without-m2eclipse"><a class="anchor" href="#importing-into-eclipse-without-m2eclipse"></a><a class="link" href="#importing-into-eclipse-without-m2eclipse">15.3.2. Importing into eclipse without m2eclipse</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>If you prefer not to use m2eclipse you can generate eclipse project metadata using the
|
||||
following command:</p>
|
||||
@@ -1754,7 +1776,7 @@ from the <code>file</code> menu.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect1">
|
||||
<h2 id="_contributing"><a class="link" href="#_contributing">Contributing</a></h2>
|
||||
<h2 id="contributing"><a class="anchor" href="#contributing"></a><a class="link" href="#contributing">16. Contributing</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_sign_the_contributor_license_agreement"><a class="link" href="#_sign_the_contributor_license_agreement">Sign the Contributor License Agreement</a></h3>
|
||||
<h3 id="sign-the-contributor-license-agreement"><a class="anchor" href="#sign-the-contributor-license-agreement"></a><a class="link" href="#sign-the-contributor-license-agreement">16.1. Sign the Contributor License Agreement</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
<a href="https://cla.pivotal.io/sign/spring">Contributor License Agreement</a>.
|
||||
@@ -1775,7 +1797,7 @@ given the ability to merge pull requests.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_of_conduct"><a class="link" href="#_code_of_conduct">Code of Conduct</a></h3>
|
||||
<h3 id="code-of-conduct"><a class="anchor" href="#code-of-conduct"></a><a class="link" href="#code-of-conduct">16.2. Code of Conduct</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>This project adheres to the Contributor Covenant <a href="https://github.com/spring-cloud/spring-cloud-build/blob/master/docs/src/main/asciidoc/code-of-conduct.adoc">code of
|
||||
conduct</a>. By participating, you are expected to uphold this code. Please report
|
||||
@@ -1783,7 +1805,7 @@ unacceptable behavior to <a href="mailto:spring-code-of-conduct@pivotal.io">spri
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_code_conventions_and_housekeeping"><a class="link" href="#_code_conventions_and_housekeeping">Code Conventions and Housekeeping</a></h3>
|
||||
<h3 id="code-conventions-and-housekeeping"><a class="anchor" href="#code-conventions-and-housekeeping"></a><a class="link" href="#code-conventions-and-housekeeping">16.3. Code Conventions and Housekeeping</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>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.</p>
|
||||
@@ -1831,7 +1853,7 @@ message (where XXXX is the issue number).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_checkstyle"><a class="link" href="#_checkstyle">Checkstyle</a></h3>
|
||||
<h3 id="checkstyle"><a class="anchor" href="#checkstyle"></a><a class="link" href="#checkstyle">16.4. Checkstyle</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Spring Cloud Build comes with a set of checkstyle rules. You can find them in the <code>spring-cloud-build-tools</code> module. The most notable files under the module are:</p>
|
||||
</div>
|
||||
@@ -1864,7 +1886,7 @@ message (where XXXX is the issue number).</p>
|
||||
</table>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_checkstyle_configuration"><a class="link" href="#_checkstyle_configuration">Checkstyle configuration</a></h4>
|
||||
<h4 id="checkstyle-configuration"><a class="anchor" href="#checkstyle-configuration"></a><a class="link" href="#checkstyle-configuration">16.4.1. Checkstyle configuration</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>Checkstyle rules are <strong>disabled by default</strong>. To add checkstyle to your project just define the following properties and plugins.</p>
|
||||
</div>
|
||||
@@ -1934,11 +1956,11 @@ message (where XXXX is the issue number).</p>
|
||||
<div class="content">
|
||||
<pre><?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></pre>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1954,9 +1976,9 @@ $ touch .springformat</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_ide_setup"><a class="link" href="#_ide_setup">IDE setup</a></h3>
|
||||
<h3 id="ide-setup"><a class="anchor" href="#ide-setup"></a><a class="link" href="#ide-setup">16.5. IDE setup</a></h3>
|
||||
<div class="sect3">
|
||||
<h4 id="_intellij_idea"><a class="link" href="#_intellij_idea">Intellij IDEA</a></h4>
|
||||
<h4 id="intellij-idea"><a class="anchor" href="#intellij-idea"></a><a class="link" href="#intellij-idea">16.5.1. Intellij IDEA</a></h4>
|
||||
<div class="paragraph">
|
||||
<p>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 <a href="https://github.com/spring-cloud/spring-cloud-build/tree/master/spring-cloud-build-tools">Spring Cloud Build</a> project.</p>
|
||||
@@ -2028,15 +2050,15 @@ The following files can be found in the <a href="https://github.com/spring-cloud
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
<p>Go to <code>File</code> → <code>Settings</code> → <code>Other settings</code> → <code>Checkstyle</code>. There click on the <code>+</code> icon in the <code>Configuration file</code> 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 <code>checkstyle.xml</code> : <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml</a></code>). We need to provide the following variables:</p>
|
||||
</div>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
<p><code>checkstyle.header.file</code> - please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/main/resources/checkstyle/checkstyle-header.txt</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle-header.txt</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
<p><code>checkstyle.suppressions.file</code> - default suppressions. Please point it to the Spring Cloud Build’s, <code>spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</code> file either in your cloned repo or via the <code><a href="https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml" class="bare">raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/checkstyle/checkstyle-suppressions.xml</a></code> URL.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><code>checkstyle.additional.suppressions.file</code> - this variable corresponds to suppressions in your local project. E.g. you’re working on <code>spring-cloud-contract</code>. Then point to the <code>project-root/src/checkstyle/checkstyle-suppressions.xml</code> folder. Example for <code>spring-cloud-contract</code> would be: <code>/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml</code>.</p>
|
||||
|
||||
Reference in New Issue
Block a user