{{- if and (not .Values.enableSqsTerminationDraining) (and .Values.enablePrometheusServer .Values.podMonitor.create) -}} apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: name: {{ template "aws-node-termination-handler.fullname" . }} namespace: {{ default .Release.Namespace .Values.podMonitor.namespace }} labels: {{- include "aws-node-termination-handler.labels" . | nindent 4 }} {{- with .Values.podMonitor.labels }} {{- toYaml . | nindent 4 }} {{- end }} spec: jobLabel: app.kubernetes.io/name namespaceSelector: matchNames: - {{ .Release.Namespace }} podMetricsEndpoints: - port: http-metrics path: /metrics {{- with .Values.podMonitor.interval }} interval: {{ . }} {{- end }} {{- with .Values.podMonitor.sampleLimit }} sampleLimit: {{ . }} {{- end }} selector: matchLabels: {{- include "aws-node-termination-handler.selectorLabelsDaemonset" . | nindent 6 }} {{- end -}}