diff --git a/helm/postgres/templates/podmonitor.yaml b/helm/postgres/templates/podmonitor.yaml new file mode 100644 index 00000000..0bc48e4e --- /dev/null +++ b/helm/postgres/templates/podmonitor.yaml @@ -0,0 +1,16 @@ +{{- if .Values.podmonitor }} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ .Values.name | quote }} + labels: + prometheus: k8s +spec: + podMetricsEndpoints: + - interval: 30s + path: /metrics + targetPort: 9187 + selector: + matchLabels: + postgres-operator.crunchydata.com/cluster: {{ .Values.name | quote }} +{{- end }} diff --git a/helm/postgres/values.yaml b/helm/postgres/values.yaml index c9283e28..0a4f52a3 100644 --- a/helm/postgres/values.yaml +++ b/helm/postgres/values.yaml @@ -38,6 +38,7 @@ # metrics exporter than can be scraped by Prometheus. This defaults to the value # below. # monitoring: false +# podmonitor: false ################### # Image Overrides #