diff --git a/chart/templates/podmonitor.yaml b/chart/templates/podmonitor.yaml index 198e7436845742f416eedce342124721dfd68c6a..b2cce3ad390505ee8b336353a99fe47d309b93da 100644 --- a/chart/templates/podmonitor.yaml +++ b/chart/templates/podmonitor.yaml @@ -5,6 +5,14 @@ kind: PodMonitor metadata: name: {{ include "hcloud-cloud-controller-manager.name" . }} namespace: {{ .Release.Namespace }} + labels: + {{- with $.Values.monitoring.podMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- range $key, $value := .Values.monitoring.podMonitor.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: {{- tpl (toYaml $.Values.monitoring.podMonitor.spec) $ | nindent 2 }} selector: diff --git a/chart/values.yaml b/chart/values.yaml index 2e2812c1a8ff0770de2315506fdd4343c1663ec1..1d889ae1b98abc202df0fc7c4fc90028686c699a 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -35,11 +35,17 @@ monitoring: # When enabled (and metrics.enabled=true), a PodMonitor will be deployed to scrape metrics. # The PodMonitor [1] CRD must already exist in the target cluster. enabled: false + # PodMonitor Labels + labels: {} + # release: kube-prometheus-stack + # PodMonitor Annotations + annotations: {} # PodMonitorSpec to be deployed. The "selector" field is set elsewhere and should *not* be used here. # https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitorSpec spec: podMetricsEndpoints: - port: metrics + nameOverride: ~