Skip to content

fix(helm): allow ingress to the metrics port in the network policies - #998

Merged
fiunchinho merged 1 commit into
mainfrom
allow-metrics-port-in-network-policies
Jul 29, 2026
Merged

fix(helm): allow ingress to the metrics port in the network policies#998
fiunchinho merged 1 commit into
mainfrom
allow-metrics-port-in-network-policies

Conversation

@fiunchinho

Copy link
Copy Markdown
Member

Why

Follow-up to #997. On gazelle, muster v1.4.2 now renders the ServiceMonitor and serves /metrics, and Alloy discovers the target — but the scrape fails (up = 0 in Mimir). Both network policy flavors allow ingress only to the aggregator port (8090), so the scraper cannot reach the prometheus port (9464). A kubectl port-forward test passes because port-forward traffic does not traverse the network policy — which is how the gap survived local verification.

What

Add the prometheus metrics port to the ingress rules of both templates, gated on the same muster.prometheusExporterEnabled helper that gates the metrics container/Service ports and the ServiceMonitor:

  • templates/ciliumnetworkpolicy.yaml: the fromEntities: [cluster] ingress rule also allows the prometheus port.
  • templates/networkpolicy.yaml: the namespaceSelector: {} ingress rule also allows the prometheus port.

When the exporter is disabled (the default), the rendered policies are unchanged.

Testing

  • helm unittest: four new cases — per flavor, default renders only 8090; with the prometheus exporter enabled (via the ServiceMonitor toggle for cilium, via exporter: "prometheus" for kubernetes) the ingress also allows 9464. 14/14 pass in the suite.
  • make helm-lint passes.
  • Verification after rollout on gazelle: up{namespace="agentic-platform", service="muster"} in Mimir should report 1.

Both network policy flavors allowed ingress only to the aggregator
port. When the prometheus exporter is enabled, Prometheus / Alloy
scrapes of the /metrics endpoint on the prometheus port were blocked
(up = 0) even with the ServiceMonitor in place. Add the prometheus
port to the ingress rules, gated on the same helper that gates the
metrics ports and the ServiceMonitor.
@fiunchinho fiunchinho self-assigned this Jul 29, 2026
@fiunchinho
fiunchinho marked this pull request as ready for review July 29, 2026 10:34
@fiunchinho
fiunchinho requested a review from a team as a code owner July 29, 2026 10:34
@fiunchinho
fiunchinho enabled auto-merge (squash) July 29, 2026 10:35
@fiunchinho
fiunchinho merged commit 2d63b8d into main Jul 29, 2026
14 checks passed
@fiunchinho
fiunchinho deleted the allow-metrics-port-in-network-policies branch July 29, 2026 11:44
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