Skip to content

feat(apexkube-agent): render a Service for the metrics agent (2.2.0) - #158

Merged
Luv7804 merged 1 commit into
mainfrom
agent/feat/apexkube-metrics-service
Oct 31, 2026
Merged

Luv7804 merged 1 commit into
mainfrom
agent/feat/apexkube-metrics-service

Conversation

@Luv7804

@Luv7804 Luv7804 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Why

The metrics profile turns a cluster into a mesh metrics destination, but it gave that agent no stable in-cluster address. Writers had to target the pod IP, so every consuming cluster created the Service itself.

That is exactly what hydra31 needed to prove the path in INTINF-428: Prometheus remote-writes to apexkube-agent-2-metrics-relay:10000/api/v1/receive, a Service applied out of band that GitOps does not own.

What

metrics.enabled: true now also renders one ClusterIP Service <fullname>-metrics on port 10000 (metrics.envoy.containerPort), targetPort: http.

No new values. The cluster that writes to the agent — local Prometheus → agent → tunnel — always needs this Service, so it is part of what the metrics profile means rather than an extra opt-in switch.

remote_write:
  - url: http://<fullname>-metrics.<namespace>.svc.cluster.local:10000/api/v1/receive

Envoy preserves the request path, so writers POST to /api/v1/receive and the backend receives it unchanged — no rewrite, no extra hop.

The Service adds discovery, not reachability: the metrics envoy already binds 0.0.0.0:10000, so the pod IP was always accepting in-cluster traffic. A cluster that only forwards mesh traffic to a local backend never uses the Service; one unused ClusterIP.

Render impact

Render Result
access-only byte-identical to published 2.1.0 apart from helm.sh/chart and the checksums derived from it; 8 objects, 0 Services
metrics profile 2.1.0 + exactly one added object: Service/<fullname>-metrics; no other object changed
metrics.envoy.containerPort: 9999 Service port follows to 9999, targetPort: http

helm lint clean on both profiles. CI's metrics values exercise the new template through ct install on all four k8s versions.

Version

2.2.0 (additive). appVersion stays 1.0.1.

Ticket: INTINF-428

The metrics profile had no stable in-cluster address: writers had to target the
pod IP, so every consuming cluster created the Service itself (hydra31 did
exactly that, out of band, to prove the mesh remote-write path end to end).

The metrics profile now renders a ClusterIP Service <fullname>-metrics on
metrics.envoy.containerPort (10000) with targetPort "http". No new values: an
agent that writes into the mesh is written to by the local Prometheus, so the
Service is part of what metrics.enabled means rather than an extra opt-in. Envoy
preserves the request path, so writers POST to /api/v1/receive and the backend
receives it unchanged.

The access profile is untouched: access-only renders byte-identical to published
2.1.0 apart from the helm.sh/chart version and the checksums derived from it.
For the metrics profile the only difference is the one added Service.

Ticket: INTINF-428
@Luv7804
Luv7804 force-pushed the agent/feat/apexkube-metrics-service branch from c350ed0 to a3a2630 Compare October 31, 2026 07:22
@Luv7804 Luv7804 changed the title feat(apexkube-agent): optional Service in front of the metrics agent (2.2.0) feat(apexkube-agent): render a Service for the metrics agent (2.2.0) Oct 31, 2026
@Luv7804
Luv7804 merged commit d667048 into main Oct 31, 2026
4 checks passed
@Luv7804
Luv7804 deleted the agent/feat/apexkube-metrics-service branch October 31, 2026 07:25
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.

2 participants