Skip to content

Commit 341a585

Browse files
committed
Bumping versions
1 parent 8a0dfe9 commit 341a585

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

README.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ spring.cloud.kubernetes.discovery.all-namespaces=true
184184
----
185185
====
186186

187+
To discover services and endpoints only from specified namespaces you should set property `all-namespaces` to `false` and set the following property in `application.properties` (in this example namespaces are: `ns1` and `ns2`).
188+
189+
====
190+
[source]
191+
----
192+
spring.cloud.kubernetes.discovery.namespaces[0]=ns1
193+
spring.cloud.kubernetes.discovery.namespaces[1]=ns2
194+
----
195+
====
196+
187197
To discover service endpoint addresses that are not marked as "ready" by the kubernetes api server, you can set the following property in `application.properties` (default: false):
188198

189199
====
@@ -223,7 +233,17 @@ this to work, you need to align the Kubernetes service name with the `spring.app
223233
NOTE: `spring.application.name` has no effect as far as the name registered for the application within Kubernetes
224234

225235
Spring Cloud Kubernetes can also watch the Kubernetes service catalog for changes and update the
226-
`DiscoveryClient` implementation accordingly. In order to enable this functionality you need to add
236+
`DiscoveryClient` implementation accordingly. By "watch" we mean that we will publish a heartbeat event every `spring.cloud.kubernetes.discovery.catalog-services-watch-delay`
237+
milliseconds (by default it is `30000`). The heartbeat event will contain the target references (and their namespaces of the addresses of all endpoints
238+
(for the exact details of what will get returned you can take a look inside `KubernetesCatalogWatch`). This is an implementation detail, and listeners of the heartbeat event
239+
should not rely on the details. Instead, they should see if there are differences between two subsequent heartbeats via `equals` method. We will take care to return a correct implementation that adheres to the equals contract.
240+
The endpoints will be queried in either all namespaces (enabled via `spring.cloud.kubernetes.discovery.all-namespaces=true`), or
241+
we will use: xref:property-source-config.adoc#namespace-resolution[Namespace Resolution].
242+
243+
244+
245+
246+
In order to enable this functionality you need to add
227247
`@EnableScheduling` on a configuration class in your application.
228248

229249
== Kubernetes native service discovery

docs/src/main/asciidoc/_configprops.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
|spring.cloud.kubernetes.config.sources | |
6060
|spring.cloud.kubernetes.config.use-name-as-prefix | `+++false+++` |
6161
|spring.cloud.kubernetes.discovery.all-namespaces | `+++false+++` |
62-
|spring.cloud.kubernetes.discovery.namespaces | `+++[]+++` |
63-
|spring.cloud.kubernetes.discovery.cache-loading-timeout-seconds | `+++60+++` |
62+
|spring.cloud.kubernetes.discovery.cache-loading-timeout-seconds | `+++60+++` |
6463
|spring.cloud.kubernetes.discovery.enabled | `+++true+++` |
6564
|spring.cloud.kubernetes.discovery.filter | |
6665
|spring.cloud.kubernetes.discovery.include-not-ready-addresses | `+++false+++` |
@@ -71,6 +70,7 @@
7170
|spring.cloud.kubernetes.discovery.metadata.annotations-prefix | |
7271
|spring.cloud.kubernetes.discovery.metadata.labels-prefix | |
7372
|spring.cloud.kubernetes.discovery.metadata.ports-prefix | `+++port.+++` |
73+
|spring.cloud.kubernetes.discovery.namespaces | |
7474
|spring.cloud.kubernetes.discovery.order | `+++0+++` |
7575
|spring.cloud.kubernetes.discovery.primary-port-name | |
7676
|spring.cloud.kubernetes.discovery.service-labels | |

0 commit comments

Comments
 (0)