{{- if .Values.enabled }} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "pgbouncer.fullname" . }}-bootstrap namespace: {{ include "pgbouncer.namespace" . }} labels: {{- include "pgbouncer.labels" . | nindent 4 }} data: entrypoint.sh: | #!/bin/sh set -eu POSTGRES_HOST="${POSTGRES_HOST:?POSTGRES_HOST is required}" POSTGRES_PORT="${POSTGRES_PORT:-5432}" PGBOUNCER_PORT="${PGBOUNCER_PORT:-6432}" POSTGRES_SUPERUSER_NAME="${POSTGRES_USER:-postgres}" DB_USER_SERVER_NAME="${DB_USER_SERVER:-app_user}" SERVER_DATABASE="${SERVER_DATABASE:-server}" ADMIN_DATABASE="${ADMIN_DATABASE:-postgres}" cat > /work/pgbouncer.ini < /work/userlist.txt chmod 600 /work/userlist.txt exec pgbouncer /work/pgbouncer.ini {{- end }}