Skip to content

[bitnami/postgresql-ha] pgpool is mapping PGPOOL_POSTGRES_PASSWORD env. var. from wrong secretKeyRef #32807

@rstribrn

Description

@rstribrn

Name and Version

bitnami/postgresql-ha-15.3.8

What architecture are you using?

None

What steps will reproduce the bug?

Deploy HelmChart using different passwords (values) defined in secret "my-db-secret", and use this secret file in "postgresql.existingSecret: my-db-secret".

postgresql-ha-15.3.8.tgz/postgresql-ha/templates/pgpool/deployment.yaml

            {{- if .Values.postgresql.usePasswordFiles }}
            - name: PGPOOL_POSTGRES_PASSWORD_FILE
              value: "/opt/bitnami/pgpool/secrets/pgpool-password"
            {{- else }}
            - name: PGPOOL_POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: {{ include "postgresql-ha.postgresqlSecretName" . }}
                  key: password
            {{- end }}

key should be "postgres-password", not "password".

Secret file content example below.

How to test:

kubectl exec --tty --stdin -n <my_namespace> pod/my-postgresql-ha-pgpool-b9c77db9d-q5wrt -- bash -c "env | sort"

=> check content of PGPOOL_POSTGRES_PASSWORD
=> using wrong password
=> pgpool keeps restarting (due to invalid probe)...

Are you using any custom parameters or values?

secret-postgresql.yaml

apiVersion: v1
kind: Secret
metadata:
  name: my-db-secret
  labels:
    {{ toYaml .Values.global.labels | nindent 4 }}
type: Opaque
stringData:
  postgres-password: pwd1
  password: pwd2
  repmgr-password: pwd3

What is the expected behavior?

PGPOOL_POSTGRES_PASSWORD should use password from correct secretKeyRef.

What do you see instead?

Password from the other key.

Metadata

Metadata

Assignees

Labels

postgresql-hasolvedstale15 days without activitytech-issuesThe user has a technical issue about an applicationtriageTriage is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions