Files
devops-infra-helm-charts-gcp/helm-templates/keda-2.17.1/templates/metrics-server/podmonitor.yaml
T
2026-08-26 03:39:42 +05:30

44 lines
1.4 KiB
YAML

{{- if and .Values.prometheus.metricServer.enabled .Values.prometheus.metricServer.podMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: {{ .Values.operator.name }}-metrics-apiserver
{{- with .Values.additionalAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | indent 4 }}
{{- range $key, $value := .Values.prometheus.metricServer.podMonitor.additionalLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- with .Values.prometheus.metricServer.podMonitor.namespace }}
namespace: {{ . }}
{{- end }}
spec:
podMetricsEndpoints:
- port: {{ .Values.prometheus.metricServer.portName }}
path: /metrics
{{- with .Values.prometheus.metricServer.podMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.prometheus.metricServer.podMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .Values.prometheus.metricServer.podMonitor.relabelings }}
relabelings:
{{ toYaml . | indent 4 }}
{{- end }}
{{- with .Values.prometheus.metricServer.podMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 4 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app: {{ .Values.operator.name }}-metrics-apiserver
{{- end }}