diff --git a/README.adoc b/README.adoc index b1ec7f7a..5281777c 100644 --- a/README.adoc +++ b/README.adoc @@ -593,7 +593,7 @@ Notice that `spring.cloud.kubernetes.config.useNameAsPrefix` has a _lower_ prior This allows you to set a "default" strategy for all sources, at the same time allowing to override only a few. If using the config map name is not an option, you can specify a different strategy, called : `explicitPrefix`. Since this is an _explicit_ prefix that -you select, it can only be supplied to the `sources` level. At the same time it has a higher priority than `useNameASPrefix`. Let's suppose we have a third config map with these entries: +you select, it can only be supplied to the `sources` level. At the same time it has a higher priority than `useNameAsPrefix`. Let's suppose we have a third config map with these entries: ==== @@ -640,6 +640,50 @@ will result in three properties being generated: - `config-map-three.greetings.message` equal to `Say Hello from three`. +By default, besides reading the config map that is specified in the `sources` configuration, Spring will also try to read +all properties from "profile aware" sources. The easiest way to explain this is via an example. Let's suppose your application +enables a profile called "dev" and you have a configuration like the one below: + +==== +[source,yaml] +---- +spring: + application: + name: spring-k8s + cloud: + kubernetes: + config: + namespace: default-namespace + sources: + - name: config-map-one +---- +==== + +Besides reading the `config-map-one`, Spring will also try to read `config-map-one-dev`; in this particular order. Each active profile +generates such a profile aware config map. + +Though your application should not be impacted by such a config map, it can be disabled if needed: + +==== +[source,yaml] +---- +spring: + application: + name: spring-k8s + cloud: + kubernetes: + config: + includeProfileSpecificSources: false + namespace: default-namespace + sources: + - name: config-map-one + includeProfileSpecificSources: false +---- +==== + +Notice that just like before, there are two levels where you can specify this property: for all config maps or +for individual ones; the latter having a higher priority. + NOTE: You should check the security configuration section. To access config maps from inside a pod you need to have the correct Kubernetes service accounts, roles and role bindings. @@ -1414,7 +1458,7 @@ https://kubernetes.io/docs/concepts/configuration/configmap/[Config Maps] and ht This is component is completely optional. However, it allows you to continue to leverage configuration you may have stored in existing environment repositories (Git, SVN, Vault, etc) with applications that you are running on Kubernetes. -A default image is located on Docker Hub which will allow you to easily get a Config Server deployed on Kubernetes without building +A default image is located on https://hub.docker.com/r/springcloud/spring-cloud-kubernetes-configserver[Docker Hub] which will allow you to easily get a Config Server deployed on Kubernetes without building the code and image yourself. However, if you need to customize the config server behavior you can easily build your own image from the source code on GitHub and use that. @@ -1655,7 +1699,7 @@ instance of a given service. Below is a sample response when a `GET` request is ### Deployment YAML -An image of the Spring Cloud Discovery Server is hosted on Docker Hub. +An image of the Spring Cloud Discovery Server is hosted on https://hub.docker.com/r/springcloud/spring-cloud-kubernetes-discoveryserver[Docker Hub]. Below is a sample deployment YAML you can use to deploy the Kubernetes Configuration Watcher to Kubernetes. diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc index eb395bf6..b520858b 100644 --- a/docs/src/main/asciidoc/_configprops.adoc +++ b/docs/src/main/asciidoc/_configprops.adoc @@ -48,6 +48,7 @@ |spring.cloud.kubernetes.client.watchReconnectLimit | `-1` | Reconnect Interval limit retries |spring.cloud.kubernetes.config.enable-api | `true` | |spring.cloud.kubernetes.config.enabled | `true` | Enable the ConfigMap property source locator. +|spring.cloud.kubernetes.config.include-profile-specific-sources | `true` | |spring.cloud.kubernetes.config.name | | |spring.cloud.kubernetes.config.namespace | | |spring.cloud.kubernetes.config.paths | | @@ -92,6 +93,7 @@ |spring.cloud.kubernetes.reload.strategy | | Sets the reload strategy for Kubernetes configuration reload on change. |spring.cloud.kubernetes.secrets.enable-api | `false` | |spring.cloud.kubernetes.secrets.enabled | `true` | Enable the Secrets property source locator. +|spring.cloud.kubernetes.secrets.include-profile-specific-sources | `true` | |spring.cloud.kubernetes.secrets.labels | | |spring.cloud.kubernetes.secrets.name | | |spring.cloud.kubernetes.secrets.namespace | |