Closed vchegwidden closed 1 year ago
this is for sure doable, and it is on my radar, just dropping a note here.
That would be really a nice improvement
hi @mbialkowski1 is there any progress on this one?
We badly need this feature. Can someone provide an update on this issue? We are still in Java 8 and we would really appreciate it if the fix is backward compatible with Java 8.
The PR is in review, I assume a few weeks and it will be part of main. No gurantees whatsoever. The thing is, its going to be part of main branch, jdk-17 only.
Also, spring.cloud.kubernetes.discover.filter: "metadata.labels['spring-boot']" does not have any effect. It discovers all services regardless. Any workaround for this issue as well is available? We use spring-cloud-starter-kubernetes-fabric8 dependency in the pom.
Looks like a diff issue, please raise a separate issue. Thank you.
Also, spring.cloud.kubernetes.discover.filter: "metadata.labels['spring-boot']" does not have any effect. It discovers all services regardless. Any workaround for this issue as well is available? We use spring-cloud-starter-kubernetes-fabric8 dependency in the pom.
This seems to ("almost") work:
spring:
cloud:
kubernetes:
discovery:
all-namespaces: true
filter: "#root.metadata.namespace matches '^uat.*$'"
On the health endpoint (show-details: always) it seems to work as there the filter seems to be applied, but my openfeign client still finds services that are not in the list and I cannot figure out why.
Any ideas why openfeign might ignore the filter?
For the ones that are not using fabric8 this might help: 990
Opened a new ticket as this one is closed.
This request is to add the ability to filter/limit namespaces to use for service discovery in the
DiscoveryClient
through a propertyWhen working as a tenant on a shared cluster we don't have permissions to view resources in all namespaces. We also don't have permissions to create cluster roles and cluster rolebindings. In these situations you can't use the
spring.cloud.kubernetes.discovery.all-namespaces=true
property since it will throw an exception when trying to get resources in namespaces you don't have access to. Not having the option to list namespaces to take into consideration means you would be limited to a single namespace for all your deployments, which isn't great...I've been trying to run Spring boot admin in a cluster where my access is limited to only the namespaces I own. When trying to use the
DiscoveryClient
and settingall-namespaces=true
the following exception is thrown since the service account doesn't have the correct permissionsThe work-around I've used is to implement my own
DiscoveryClient
that takes a list of namespaces from a property, then overriding the behaviour ofgetServices
andgetEndpointList
to only look in the namespaces supplied (Note I've only tested this with the fabric8 client)It would however be great if this was included out of the box.