Skip to content

feat: enable Kubernetes service discovery client - #142

Merged
TheMeinerLP merged 1 commit into
mainfrom
feat/k8s-service-discovery
Jun 22, 2026
Merged

feat: enable Kubernetes service discovery client#142
TheMeinerLP merged 1 commit into
mainfrom
feat/k8s-service-discovery

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Why

In-cluster, /health showed compositeDiscoveryClient with an empty services: {} — no discovery backend was configured. This adds Micronaut's Kubernetes discovery client so the app discovers services in its own namespace.

What

  • Add 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:

  • RBAC: get/list/watch on services and endpoints (added in the Helm chart helm/micronaut).
  • The k8s environment active (set via the deployment's profiles).

See the companion Kubernetes-FLUX change for the RBAC + release wiring.

Verification

  • ./gradlew :backend:compileJava
  • Resolves: micronaut-kubernetes-discovery-client:7.1.1, micronaut-discovery-client:4.7.1.

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.
@github-actions

Copy link
Copy Markdown
Contributor

Test results

 6 files   6 suites   0s ⏱️
 5 tests  4 ✅ 1 💤 0 ❌
15 runs  12 ✅ 3 💤 0 ❌

Results for commit 257018b.

@TheMeinerLP
TheMeinerLP merged commit 569dacc into main Jun 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant