Skip to content

Metrics Service setup only exposes metrics from a single control plane instance #777

@tobiasgiese

Description

@tobiasgiese

Hi 👋

I’ve just tested the metrics exposure for Kamaji. Since we’re not using prometheus-operator (yet), I had to adapt the configuration to use classic Prometheus scrape configs — that part is all good.

However, while doing so I noticed an issue:
Kamaji creates a Service of type ClusterIP and configures scraping from it. This results in Prometheus only scraping metrics from one control plane instance, rather than all of them.

This is a problem because:

  • While the Kubernetes API is stateless, the metrics are not aggregated between control planes.
  • Scraping through a ClusterIP service results in Prometheus hitting just one of the backing Pods.

Suggested improvements:

  • Use a headless Service instead.
  • For classic Prometheus setups, leverage the dns_sd_configs feature to discover all Pod endpoints behind the headless Service.
  • For prometheus-operator, this might be solvable with endpoints or podMonitor, but I currently can’t test this.

Maybe related: prometheus-operator/prometheus-operator#1899

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions