Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chart/templates/postgres-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ spec:
secretKeyRef:
name: postgres.pg-cluster.credentials.postgresql.acid.zalan.do
key: password
enableConnectionPooler: false
{{- end }}
6 changes: 3 additions & 3 deletions releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
flavors:
- name: upstream
# renovate-uds: datasource=docker depName=ghcr.io/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.1-uds.1
version: 1.15.1-uds.2
- name: registry1
# renovate-uds: datasource=docker depName=registry1.dso.mil/ironbank/opensource/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.0-uds.1
version: 1.15.0-uds.2
- name: unicorn
# renovate-uds: datasource=docker depName=quay.io/rfcurated/zalando/postgres-operator extractVersion=^v?(?<version>\d+\.\d+\.\d+)$
version: 1.15.0-uds.1
version: 1.15.0-uds.2
26 changes: 26 additions & 0 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tasks:
actions:
- task: health-check
- task: create-dbs
- task: configure-pgbouncer

- name: create-dbs
actions:
Expand All @@ -23,3 +24,28 @@ tasks:
name: app.kubernetes.io/name=postgres-operator
namespace: postgres-operator
condition: Ready

- name: configure-pgbouncer
description: "Prove pgbouncer deployment isn't working, then configure and verify."
actions:
- cmd: ./zarf tools kubectl get postgresql -n postgres -o jsonpath="{.items[0].spec.enableConnectionPooler}"
setVariables:
- name: POOLER_ENABLED
- description: Check status and apply fix
cmd: |
if [ "${POOLER_ENABLED}" = "false" ]; then
echo "PgBouncer was not deployed." && exit 0
fi
CLUSTER_NAME=$(./zarf tools kubectl get postgresql -n postgres -o jsonpath="{.items[0].metadata.name}")
if ./zarf tools kubectl rollout status deployment/"$CLUSTER_NAME-pooler" -n postgres --timeout=5s; then
echo "PgBouncer already healthy!" && exit 0
else
echo "Get logs of unhealthy deployment:"
./zarf tools kubectl logs -n postgres deployment/"$CLUSTER_NAME-pooler"
fi
echo "Configuring connection-pooler"
./zarf tools wait-for deployment "$CLUSTER_NAME-pooler" exists -n postgres
./zarf tools kubectl set env -n postgres deployment "$CLUSTER_NAME-pooler" DATABASES_HOST="$CLUSTER_NAME" PGBOUNCER_LISTEN_PORT=5432
./zarf tools kubectl patch deployment "$CLUSTER_NAME-pooler" -n postgres -p \
"\{"spec":\{"template":\{"metadata":\{"labels":\{"uds/user":"70","uds/group":"70","uds/fsgroup":"70"\}\}\}\}\}"
./zarf tools wait-for deployment "${CLUSTER_NAME}-pooler" available -n postgres --timeout=120s
Loading