Co-authored-by: Marco Franssen <[email protected]> Signed-off-by: Marco Franssen <[email protected]>
28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
{{- if (dig "telemetry" "prometheus" "podMonitor" "enabled" .Values.telemetry.prometheus.podMonitor.enabled .Values.global) }}
|
|
{{- $namespace := include "spiffe-oidc-discovery-provider.podMonitor.namespace" . }}
|
|
{{- $podNamespace := ( include "spiffe-oidc-discovery-provider.namespace" . ) }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: PodMonitor
|
|
metadata:
|
|
name: {{ include "spiffe-oidc-discovery-provider.fullname" . }}
|
|
namespace: {{ $namespace }}
|
|
labels:
|
|
{{- include "spiffe-oidc-discovery-provider.labels" . | nindent 4 }}
|
|
{{- if ne (len (dig "telemetry" "prometheus" "podMonitor" "labels" (dict) .Values.global)) 0 }}
|
|
{{- .Values.global.telemetry.prometheus.podMonitor.labels | toYaml | nindent 4 }}
|
|
{{- end }}
|
|
{{- with .Values.telemetry.prometheus.podMonitor.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "spiffe-oidc-discovery-provider.selectorLabels" . | nindent 6 }}
|
|
podMetricsEndpoints:
|
|
- port: prom
|
|
{{- if ne $namespace $podNamespace }}
|
|
namespaceSelector:
|
|
kubernetes.io/metadata.name: {{ $podNamespace }}
|
|
{{- end }}
|
|
{{- end }}
|