Use endpoint slices for fabric8 catalog watcher (#1149)

This commit is contained in:
erabii
2022-12-06 23:55:54 +02:00
committed by GitHub
parent 4d48adaaa7
commit 3dcab2bc69
30 changed files with 867 additions and 176 deletions

View File

@@ -134,8 +134,19 @@ should not rely on the details. Instead, they should see if there are difference
The endpoints will be queried in either all namespaces (enabled via `spring.cloud.kubernetes.discovery.all-namespaces=true`), or
we will use: xref:property-source-config.adoc#namespace-resolution[Namespace Resolution].
In order to enable this functionality you need to add
`@EnableScheduling` on a configuration class in your application.
By default, we use the `Endpoints`(see https://kubernetes.io/docs/concepts/services-networking/service/#endpoints) API to find out the current state of services. There is another way though, via `EndpointSlices` (https://kubernetes.io/docs/concepts/services-networking/endpoint-slices/). Such support can be enabled via a property: `spring.cloud.kubernetes.discovery.use-endpoint-slices=true` (by default it is `false`). Of course, your cluster has to support it also. As a matter of fact, if you enable this property, but your cluster does not support it, we will fail starting the application. If you decide to enable such support, you also need proper Role/ClusterRole set-up. For example:
```
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: default
name: namespace-reader
rules:
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["get", "list", "watch"]
```