2021-12-01 15:43:42 +00:00
|
|
|
{{- 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" . }}
|
2022-04-08 15:10:17 +00:00
|
|
|
namespace: {{ default .Release.Namespace .Values.podMonitor.namespace }}
|
2021-12-01 15:43:42 +00:00
|
|
|
labels:
|
|
|
|
{{- include "aws-node-termination-handler.labels" . | nindent 4 }}
|
|
|
|
{{- with .Values.podMonitor.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
|
|
|
spec:
|
2022-01-28 16:22:12 +00:00
|
|
|
jobLabel: app.kubernetes.io/name
|
2021-12-01 15:43:42 +00:00
|
|
|
namespaceSelector:
|
|
|
|
matchNames:
|
|
|
|
- {{ .Release.Namespace }}
|
|
|
|
podMetricsEndpoints:
|
|
|
|
- port: http-metrics
|
|
|
|
path: /metrics
|
|
|
|
{{- with .Values.podMonitor.interval }}
|
|
|
|
interval: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.podMonitor.sampleLimit }}
|
|
|
|
sampleLimit: {{ . }}
|
|
|
|
{{- end }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2022-01-28 16:22:12 +00:00
|
|
|
{{- include "aws-node-termination-handler.selectorLabelsDaemonset" . | nindent 6 }}
|
2021-12-01 15:43:42 +00:00
|
|
|
{{- end -}}
|