pod-volume-cleaner/helm/templates/podmonitor.yaml
2022-10-13 15:17:11 +02:00

30 lines
954 B
YAML

{{- if .Values.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ include "pod-cleaner.fullname" . }}
labels:
{{- include "pod-cleaner.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "pod-cleaner.labels" . | nindent 6 }}
podMetricsEndpoints:
- port: {{ include "pod-cleaner.metrics.portName" . | quote }}
path: {{ .Values.podMonitor.path | quote }}
{{- if .Values.podMonitor.tlsConfig }}
scheme: "https"
tlsConfig:
{{- toYaml .Values.podMonitor.tlsConfig | trim | nindent 8 }}
{{- end }}
interval: {{ .Values.podMonitor.interval }}
scrapeTimeout: {{ .Values.podMonitor.additionalLabels }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- if .Values.podMonitor.additionalLabels }}
jobLabel:
{{- toYaml .Values.podMonitor.additionalLabels | trim | nindent 4 }}
{{- end }}
{{- end }}