diff --git a/multi/multi__building.html b/multi/multi__building.html index 072816d8..8879b67a 100644 --- a/multi/multi__building.html +++ b/multi/multi__building.html @@ -1,6 +1,6 @@ - 13. Building

13. Building

13.1 Basic Compile and Test

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

Spring Cloud uses Maven for most build-related activities, and you + 14. Building

14. Building

14.1 Basic Compile and Test

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

Spring Cloud uses Maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing

$ ./mvnw install
[Note]Note

You can also install Maven (>=3.3.3) yourself and run the mvn command in place of ./mvnw in the examples below. If you do that you also @@ -22,18 +22,18 @@ in Docker containers. See the README in the scripts demo repository for specific instructions about the common cases of mongo, rabbit and redis.

[Note]Note

If all else fails, build with the command from .travis.yml (usually -./mvnw install).

13.2 Documentation

The spring-cloud-build module has a "docs" profile, and if you switch +./mvnw install).

14.2 Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from src/main/asciidoc. As part of that process it will look for a README.adoc and process it by loading all the includes, but not parsing or rendering it, just copying it to ${main.basedir} (defaults to ${basedir}, i.e. the root of the project). If there are any changes in the README it will then show up after a Maven build as -a modified file in the correct place. Just commit it and push the change.

13.3 Working with the code

If you don’t have an IDE preference we would recommend that you use +a modified file in the correct place. Just commit it and push the change.

14.3 Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or Eclipse when working with the code. We use the m2eclipse eclipse plugin for maven support. Other IDEs and tools -should also work without issue as long as they use Maven 3.3.3 or better.

13.3.1 Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with +should also work without issue as long as they use Maven 3.3.3 or better.

14.3.1 Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse marketplace".

[Note]Note

Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell @@ -42,6 +42,6 @@ see many different errors related to the POMs in the projects, check that you have an up to date installation. If you can’t upgrade m2e, add the "spring" profile to your settings.xml. Alternatively you can copy the repository settings from the "spring" profile of the parent -pom into your settings.xml.

13.3.2 Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the +pom into your settings.xml.

14.3.2 Importing into eclipse without m2eclipse

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

$ ./mvnw eclipse:eclipse

The generated eclipse projects can be imported by selecting import existing projects -from the file menu.

\ No newline at end of file +from the file menu.

\ No newline at end of file diff --git a/multi/multi__contributing.html b/multi/multi__contributing.html index 45650415..96e724b3 100644 --- a/multi/multi__contributing.html +++ b/multi/multi__contributing.html @@ -1,17 +1,17 @@ - 14. Contributing

14. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, + 15. Contributing

15. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but -follow the guidelines below.

14.1 Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the +follow the guidelines below.

15.1 Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and -given the ability to merge pull requests.

14.2 Code of Conduct

This project adheres to the Contributor Covenant code of +given the ability to merge pull requests.

15.2 Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report -unacceptable behavior to spring-code-of-conduct@pivotal.io.

14.3 Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be +unacceptable behavior to spring-code-of-conduct@pivotal.io.

15.3 Code Conventions and Housekeeping

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

  • Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the @@ -25,7 +25,7 @@ in the project)
  • Add yourself as an Add some Javadocs and, if you change the namespace, some XSD doc elements.
  • A few unit tests would help a lot as well — someone has to do it.
  • If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
  • When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit -message (where XXXX is the issue number).

14.4 Checkstyle

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

spring-cloud-build-tools/.  +message (where XXXX is the issue number).

15.4 Checkstyle

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

spring-cloud-build-tools/. 

└── src
     ├── checkstyle
     │   └── checkstyle-suppressions.xml 1
@@ -33,7 +33,7 @@ message (where XXXX is the issue number).
2    └── checkstyle.xml 3

-

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

14.4.1 Checkstyle configuration

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

pom.xml.  +

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

15.4.1 Checkstyle configuration

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

pom.xml. 

<properties>
 <maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> 1
         <maven-checkstyle-plugin.failsOnViolation>true
@@ -73,7 +73,7 @@ message (where XXXX is the issue number).

It’s advisable to copy the ${spring-cloud-build.rootFolder}/.editorconfig and ${spring-cloud-build.rootFolder}/.springformat to your project. That way, some default formatting rules will be applied. You can do so by running this script:

$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat

14.5 IDE setup

14.5.1 Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.

spring-cloud-build-tools/.  +$ touch .springformat

15.5 IDE setup

15.5.1 Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.

spring-cloud-build-tools/. 

└── src
     ├── checkstyle
     │   └── checkstyle-suppressions.xml 1
@@ -84,4 +84,4 @@ $ touch .springformat
4       └── Intellij_Spring_Boot_Java_Conventions.xml 5

-

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

4

Project defaults for Intellij that apply most of Checkstyle rules

5

Project style conventions for Intellij that apply most of Checkstyle rules

Figure 14.1. Code style

Code style

Go to FileSettingsEditorCode style. There click on the icon next to the Scheme section. There, click on the Import Scheme value and pick the Intellij IDEA code style XML option. Import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml file.

Figure 14.2. Inspection profiles

Code style

Go to FileSettingsEditorInspections. There click on the icon next to the Profile section. There, click on the Import Profile and import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml file.

Checkstyle. To have Intellij work with Checkstyle, you have to install the Checkstyle plugin. It’s advisable to also install the Assertions2Assertj to automatically convert the JUnit assertions

Checkstyle

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

[Important]Important

Remember to set the Scan Scope to All sources since we apply checkstyle rules for production and test sources.

\ No newline at end of file +

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

4

Project defaults for Intellij that apply most of Checkstyle rules

5

Project style conventions for Intellij that apply most of Checkstyle rules

Figure 15.1. Code style

Code style

Go to FileSettingsEditorCode style. There click on the icon next to the Scheme section. There, click on the Import Scheme value and pick the Intellij IDEA code style XML option. Import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml file.

Figure 15.2. Inspection profiles

Code style

Go to FileSettingsEditorInspections. There click on the icon next to the Profile section. There, click on the Import Profile and import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml file.

Checkstyle. To have Intellij work with Checkstyle, you have to install the Checkstyle plugin. It’s advisable to also install the Assertions2Assertj to automatically convert the JUnit assertions

Checkstyle

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

[Important]Important

Remember to set the Scan Scope to All sources since we apply checkstyle rules for production and test sources.

\ No newline at end of file diff --git a/multi/multi__examples.html b/multi/multi__examples.html index e23fce1c..62a56171 100644 --- a/multi/multi__examples.html +++ b/multi/multi__examples.html @@ -1,5 +1,5 @@ - 11. Examples

11. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by + 12. Examples

12. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by following the Spring Cloud interfaces.

In your applications, you need to add the spring-cloud-kubernetes-discovery dependency to your classpath and remove any other dependency that contains a DiscoveryClient implementation (that is, a Eureka discovery client). -The same applies for PropertySourceLocator, where you need to add to the classpath the spring-cloud-kubernetes-config and remove any other dependency that contains a PropertySourceLocator implementation (that is, a configuration server client).

The following projects highlight the usage of these dependencies and demonstrate how you can use these libraries from any Spring Boot application:

\ No newline at end of file +The same applies for PropertySourceLocator, where you need to add to the classpath the spring-cloud-kubernetes-config and remove any other dependency that contains a PropertySourceLocator implementation (that is, a configuration server client).

The following projects highlight the usage of these dependencies and demonstrate how you can use these libraries from any Spring Boot application:

\ No newline at end of file diff --git a/multi/multi__other_resources.html b/multi/multi__other_resources.html index 4bf36588..1869bfa0 100644 --- a/multi/multi__other_resources.html +++ b/multi/multi__other_resources.html @@ -1,3 +1,3 @@ - 12. Other Resources

12. Other Resources

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

Please feel free to submit other resources through pull requests to this repository.

\ No newline at end of file + 13. Other Resources

13. Other Resources

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

Please feel free to submit other resources through pull requests to this repository.

\ No newline at end of file diff --git a/multi/multi__security_configurations_inside_kubernetes.html b/multi/multi__security_configurations_inside_kubernetes.html index b655e24b..df5e3e16 100644 --- a/multi/multi__security_configurations_inside_kubernetes.html +++ b/multi/multi__security_configurations_inside_kubernetes.html @@ -1,9 +1,9 @@ - 10. Security Configurations Inside Kubernetes

10. Security Configurations Inside Kubernetes

10.1 Namespace

Most of the components provided in this project need to know the namespace. For Kubernetes (1.3+), the namespace is made available to the pod as part of the service account secret and is automatically detected by the client. + 10. Security Configurations Inside Kubernetes

10. Security Configurations Inside Kubernetes

10.1 Namespace

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

      env:
       - name: "KUBERNETES_NAMESPACE"
         valueFrom:
           fieldRef:
             fieldPath: "metadata.namespace"

10.2 Service Account

For distributions of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. -For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles. For example, you can add cluster-reader permissions to your default service account, depending on the project you’re in.

\ No newline at end of file +For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles. For example, you can add cluster-reader permissions to your default service account, depending on the project you’re in.

\ No newline at end of file diff --git a/multi/multi__service_registry_implementation.html b/multi/multi__service_registry_implementation.html new file mode 100644 index 00000000..55369882 --- /dev/null +++ b/multi/multi__service_registry_implementation.html @@ -0,0 +1,5 @@ + + + 11. Service Registry Implementation

11. Service Registry Implementation

In Kubernetes service registration is controlled by the platform, the application itself does not control +registration as it may do in other platforms. For this reason using spring.cloud.service-registry.auto-registration.enabled +or setting @EnableDiscoveryClient(autoRegister=false) will have no effect in Spring Cloud Kubernetes.

\ No newline at end of file diff --git a/multi/multi_spring-cloud-kubernetes.html b/multi/multi_spring-cloud-kubernetes.html index 6eef4c5e..c210bbe6 100644 --- a/multi/multi_spring-cloud-kubernetes.html +++ b/multi/multi_spring-cloud-kubernetes.html @@ -1,3 +1,3 @@ - Spring Cloud Kubernetes

Spring Cloud Kubernetes


\ No newline at end of file + Spring Cloud Kubernetes

Spring Cloud Kubernetes


\ No newline at end of file diff --git a/single/spring-cloud-kubernetes.html b/single/spring-cloud-kubernetes.html index 90faf6ff..06023084 100644 --- a/single/spring-cloud-kubernetes.html +++ b/single/spring-cloud-kubernetes.html @@ -1,6 +1,6 @@ - Spring Cloud Kubernetes

Spring Cloud Kubernetes


This reference guide covers how to use Spring Cloud Kubernetes.

1. Why do you need Spring Cloud Kubernetes?

Spring Cloud Kubernetes provide Spring Cloud common interface implementations that consume Kubernetes native services. + Spring Cloud Kubernetes

Spring Cloud Kubernetes


This reference guide covers how to use Spring Cloud Kubernetes.

1. Why do you need Spring Cloud Kubernetes?

Spring Cloud Kubernetes provide Spring Cloud common interface implementations that consume Kubernetes native services. The main objective of the projects provided in this repository is to facilitate the integration of Spring Cloud and Spring Boot applications running inside Kubernetes.

2. Starters

Starters are convenient dependency descriptors you can include in your application. Include a starter to get the dependencies and Spring Boot auto-configuration for a feature set.

StarterFeatures
<dependency>
@@ -264,9 +264,11 @@ For earlier versions, it needs to be specified as an environment variable to the
         valueFrom:
           fieldRef:
             fieldPath: "metadata.namespace"

10.2 Service Account

For distributions of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. -For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles. For example, you can add cluster-reader permissions to your default service account, depending on the project you’re in.

11. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by +For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles. For example, you can add cluster-reader permissions to your default service account, depending on the project you’re in.

11. Service Registry Implementation

In Kubernetes service registration is controlled by the platform, the application itself does not control +registration as it may do in other platforms. For this reason using spring.cloud.service-registry.auto-registration.enabled +or setting @EnableDiscoveryClient(autoRegister=false) will have no effect in Spring Cloud Kubernetes.

12. Examples

Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by following the Spring Cloud interfaces.

In your applications, you need to add the spring-cloud-kubernetes-discovery dependency to your classpath and remove any other dependency that contains a DiscoveryClient implementation (that is, a Eureka discovery client). -The same applies for PropertySourceLocator, where you need to add to the classpath the spring-cloud-kubernetes-config and remove any other dependency that contains a PropertySourceLocator implementation (that is, a configuration server client).

The following projects highlight the usage of these dependencies and demonstrate how you can use these libraries from any Spring Boot application:

12. Other Resources

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

Please feel free to submit other resources through pull requests to this repository.

13. Building

13.1 Basic Compile and Test

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

Spring Cloud uses Maven for most build-related activities, and you +The same applies for PropertySourceLocator, where you need to add to the classpath the spring-cloud-kubernetes-config and remove any other dependency that contains a PropertySourceLocator implementation (that is, a configuration server client).

The following projects highlight the usage of these dependencies and demonstrate how you can use these libraries from any Spring Boot application:

13. Other Resources

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

Please feel free to submit other resources through pull requests to this repository.

14. Building

14.1 Basic Compile and Test

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

Spring Cloud uses Maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing

$ ./mvnw install
[Note]Note

You can also install Maven (>=3.3.3) yourself and run the mvn command in place of ./mvnw in the examples below. If you do that you also @@ -288,18 +290,18 @@ in Docker containers. See the README in the scripts demo repository for specific instructions about the common cases of mongo, rabbit and redis.

[Note]Note

If all else fails, build with the command from .travis.yml (usually -./mvnw install).

13.2 Documentation

The spring-cloud-build module has a "docs" profile, and if you switch +./mvnw install).

14.2 Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from src/main/asciidoc. As part of that process it will look for a README.adoc and process it by loading all the includes, but not parsing or rendering it, just copying it to ${main.basedir} (defaults to ${basedir}, i.e. the root of the project). If there are any changes in the README it will then show up after a Maven build as -a modified file in the correct place. Just commit it and push the change.

13.3 Working with the code

If you don’t have an IDE preference we would recommend that you use +a modified file in the correct place. Just commit it and push the change.

14.3 Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or Eclipse when working with the code. We use the m2eclipse eclipse plugin for maven support. Other IDEs and tools -should also work without issue as long as they use Maven 3.3.3 or better.

13.3.1 Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with +should also work without issue as long as they use Maven 3.3.3 or better.

14.3.1 Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse marketplace".

[Note]Note

Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell @@ -308,20 +310,20 @@ see many different errors related to the POMs in the projects, check that you have an up to date installation. If you can’t upgrade m2e, add the "spring" profile to your settings.xml. Alternatively you can copy the repository settings from the "spring" profile of the parent -pom into your settings.xml.

13.3.2 Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the +pom into your settings.xml.

14.3.2 Importing into eclipse without m2eclipse

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

$ ./mvnw eclipse:eclipse

The generated eclipse projects can be imported by selecting import existing projects -from the file menu.

14. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, +from the file menu.

15. Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but -follow the guidelines below.

14.1 Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the +follow the guidelines below.

15.1 Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and -given the ability to merge pull requests.

14.2 Code of Conduct

This project adheres to the Contributor Covenant code of +given the ability to merge pull requests.

15.2 Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report -unacceptable behavior to spring-code-of-conduct@pivotal.io.

14.3 Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be +unacceptable behavior to spring-code-of-conduct@pivotal.io.

15.3 Code Conventions and Housekeeping

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

  • Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the @@ -335,7 +337,7 @@ in the project)
  • Add yourself as an Add some Javadocs and, if you change the namespace, some XSD doc elements.
  • A few unit tests would help a lot as well — someone has to do it.
  • If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).
  • When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit -message (where XXXX is the issue number).

14.4 Checkstyle

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

spring-cloud-build-tools/.  +message (where XXXX is the issue number).

15.4 Checkstyle

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

spring-cloud-build-tools/. 

└── src
     ├── checkstyle
     │   └── checkstyle-suppressions.xml 1
@@ -343,7 +345,7 @@ message (where XXXX is the issue number).
2    └── checkstyle.xml 3

-

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

14.4.1 Checkstyle configuration

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

pom.xml.  +

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

15.4.1 Checkstyle configuration

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

pom.xml. 

<properties>
 <maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> 1
         <maven-checkstyle-plugin.failsOnViolation>true
@@ -383,7 +385,7 @@ message (where XXXX is the issue number).

It’s advisable to copy the ${spring-cloud-build.rootFolder}/.editorconfig and ${spring-cloud-build.rootFolder}/.springformat to your project. That way, some default formatting rules will be applied. You can do so by running this script:

$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
-$ touch .springformat

14.5 IDE setup

14.5.1 Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.

spring-cloud-build-tools/.  +$ touch .springformat

15.5 IDE setup

15.5.1 Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin.

spring-cloud-build-tools/. 

└── src
     ├── checkstyle
     │   └── checkstyle-suppressions.xml 1
@@ -394,4 +396,4 @@ $ touch .springformat
4       └── Intellij_Spring_Boot_Java_Conventions.xml 5

-

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

4

Project defaults for Intellij that apply most of Checkstyle rules

5

Project style conventions for Intellij that apply most of Checkstyle rules

Figure 14.1. Code style

Code style

Go to FileSettingsEditorCode style. There click on the icon next to the Scheme section. There, click on the Import Scheme value and pick the Intellij IDEA code style XML option. Import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml file.

Figure 14.2. Inspection profiles

Code style

Go to FileSettingsEditorInspections. There click on the icon next to the Profile section. There, click on the Import Profile and import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml file.

Checkstyle. To have Intellij work with Checkstyle, you have to install the Checkstyle plugin. It’s advisable to also install the Assertions2Assertj to automatically convert the JUnit assertions

Checkstyle

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

[Important]Important

Remember to set the Scan Scope to All sources since we apply checkstyle rules for production and test sources.

\ No newline at end of file +

3

Default Checkstyle rules

2

File header setup

1

Default suppression rules

4

Project defaults for Intellij that apply most of Checkstyle rules

5

Project style conventions for Intellij that apply most of Checkstyle rules

Figure 15.1. Code style

Code style

Go to FileSettingsEditorCode style. There click on the icon next to the Scheme section. There, click on the Import Scheme value and pick the Intellij IDEA code style XML option. Import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml file.

Figure 15.2. Inspection profiles

Code style

Go to FileSettingsEditorInspections. There click on the icon next to the Profile section. There, click on the Import Profile and import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml file.

Checkstyle. To have Intellij work with Checkstyle, you have to install the Checkstyle plugin. It’s advisable to also install the Assertions2Assertj to automatically convert the JUnit assertions

Checkstyle

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

[Important]Important

Remember to set the Scan Scope to All sources since we apply checkstyle rules for production and test sources.

\ No newline at end of file diff --git a/spring-cloud-kubernetes.xml b/spring-cloud-kubernetes.xml index b14acecc..b4b47b4e 100644 --- a/spring-cloud-kubernetes.xml +++ b/spring-cloud-kubernetes.xml @@ -748,6 +748,12 @@ For earlier versions, it needs to be specified as an environment variable to the For any service accounts you assign to a deployment or pod, you need to make sure they have the correct roles. For example, you can add cluster-reader permissions to your default service account, depending on the project you’re in. + +Service Registry Implementation +In Kubernetes service registration is controlled by the platform, the application itself does not control +registration as it may do in other platforms. For this reason using spring.cloud.service-registry.auto-registration.enabled +or setting @EnableDiscoveryClient(autoRegister=false) will have no effect in Spring Cloud Kubernetes. + Examples Spring Cloud Kubernetes tries to make it transparent for your applications to consume Kubernetes Native Services by