{{- range $name, $spec := .Values.poolers }}
---
apiVersion: postgresql.cnpg.io/v1
kind: Pooler
metadata:
  name: {{ include "cnpg-cluster.fullname" $ }}-{{ $name }}
  labels:
    {{- include "cnpg-cluster.labels" $ | nindent 4 }}
    cnpg.io/poolerName: {{ include "cnpg-cluster.fullname" $ }}-{{ $name }}
spec:
  cluster:
    name: {{ include "cnpg-cluster.fullname" $ }}
  {{- toYaml $spec | nindent 2 }}
  monitoring:
    enablePodMonitor: {{ $.Values.monitoring.enablePodMonitor }}
{{- end }}
