Skip to content

Add MetricsPort to Goldmane operator API#4498

Open
caseydavenport wants to merge 2 commits intotigera:masterfrom
caseydavenport:casey/goldmane-prometheus-metrics
Open

Add MetricsPort to Goldmane operator API#4498
caseydavenport wants to merge 2 commits intotigera:masterfrom
caseydavenport:casey/goldmane-prometheus-metrics

Conversation

@caseydavenport
Copy link
Member

Adds a metricsPort field to the Goldmane CR spec so that Prometheus metrics can be enabled without needing to bypass the operator. When set:

  • Sets PROMETHEUS_PORT env var on the Goldmane container
  • Creates a headless goldmane-metrics Service with prometheus.io/scrape and prometheus.io/port annotations
  • Adds an ingress rule to the NetworkPolicy for the metrics port

When unset (or zero), the metrics service is cleaned up and no env var is set.

Usage:

kubectl patch goldmane default --type=merge -p '{"spec":{"metricsPort": 9081}}'

Allow users to enable Prometheus metrics on Goldmane by setting
spec.metricsPort on the Goldmane CR. When configured, the operator
sets the PROMETHEUS_PORT env var on the container, creates a headless
metrics Service with prometheus.io annotations for scrape discovery,
and opens the port in the NetworkPolicy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants