feat: enable Kubernetes service discovery client#144
Merged
Conversation
Add micronaut-kubernetes-discovery-client so the app discovers services in its own namespace via the Kubernetes API, populating the discovery client (previously the compositeDiscoveryClient health showed an empty services map). The module's beans require the k8s environment, so this stays inert in local/dev. In-cluster it needs RBAC to read services/endpoints (handled in the Helm chart) and the `k8s` environment active.
Contributor
Test results 27 files 27 suites 3s ⏱️ Results for commit fe78489. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In-cluster,
/healthshowedcompositeDiscoveryClientwith an emptyservices: {}— no discovery backend was configured. This adds Micronaut's Kubernetes discovery client so the app discovers services in its own namespace.What
micronaut-kubernetes-discovery-client(micronaut-kubernetes 7.1.1).The module's beans only activate in the Kubernetes environment, so it is inert for local/dev runs. In-cluster it additionally requires:
get/list/watchonservicesandendpoints(added in the Helm charthelm/micronaut).k8senvironment active (set via the deployment's profiles).Mirrors the Otis change; see the companion Kubernetes-FLUX change for the RBAC + release wiring.
Verification
./gradlew compileJava✅micronaut-kubernetes-discovery-client:7.1.1.