diff --git a/charts/pgbouncer/templates/podmonitor.yaml b/charts/pgbouncer/templates/podmonitor.yaml new file mode 100644 index 0000000..b6f9214 --- /dev/null +++ b/charts/pgbouncer/templates/podmonitor.yaml @@ -0,0 +1,14 @@ +{{- if .Values.pgbouncerExporter.podMonitor -}} +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: {{ include "pgbouncer.fullname" . }} + labels: + {{- include "pgbouncer.selectorLabels" . | nindent 8 }} +spec: + selector: + matchLabels: + {{- include "pgbouncer.selectorLabels" . | nindent 8 }} + podMetricsEndpoints: + - port: exporter + {{- end }} \ No newline at end of file diff --git a/charts/pgbouncer/values.yaml b/charts/pgbouncer/values.yaml index 469a3c2..d5009e6 100644 --- a/charts/pgbouncer/values.yaml +++ b/charts/pgbouncer/values.yaml @@ -190,6 +190,7 @@ extraVolumes: [] ## pgbouncerExporter: enabled: false + podMonitor: true port: 9127 image: registry: ""