Add metrics.prometheusAnnotations.enabled to drop scrape annotations

What does this MR do?

With metrics.enabled: true, the runner pod always gets the prometheus.io/scrape and prometheus.io/port annotations. If a podMonitor or serviceMonitor also scrapes the pod, a Prometheus that honors both scrapes it twice and stores duplicate series.

This MR:

  • adds metrics.prometheusAnnotations.enabled (default true, so existing installs don't change). Set it to false to drop both annotations.
  • skips a default annotation when the same key is already in podAnnotations. The current workaround (podAnnotations: {prometheus.io/scrape: "false"}) renders the key twice in the pod template. With this change, it renders once, with the user's value.

How to test

helm unittest -f 'tests/*.yaml' . runs five new cases in tests/deployment_test.yaml.

References

Resolves #597 (closed)

🤖 Generated with Claude Code

Edited by Radek Antoniuk

Merge request reports

Loading
Loading