Skip to content

Commit d608059

Browse files
feat: add ability to define extra postgres users
1 parent 28a3574 commit d608059

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

operations/deployment/crunchy-postgres/templates/PostgresCluster.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ spec:
8787
- name: postgres
8888
databases:
8989
- {{ template "crunchy-postgres.fullname" . }}
90+
{{- if .Values.postgres.extraUsers.enabled }}
91+
{{- with .Values.postgres.extraUsers.users }}
92+
{{- toYaml . | indent 2 }}
93+
{{- end }}
94+
{{- end }}
95+
9096
backups:
9197
pgbackrest:
9298
image: {{ .Values.pgbackrest.image }}

operations/deployment/crunchy-postgres/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ crunchyImage: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres:
3434
# https://access.crunchydata.com/documentation/postgres-operator/v5/architecture/pgadmin4/
3535
postgresVersion: 14
3636

37+
postgres:
38+
# List that allows an undefined amount of new users to be created
39+
# Be sure to changed the 'crunchy-postgres' database name if you changed the fullNameOverride variable
40+
extraUsers:
41+
enabled: false
42+
users: |
43+
- name: extra-user-1
44+
databases:
45+
- crunchy-postgres
46+
options: "CREATEROLE"
47+
- name: extra-user-2
48+
databases:
49+
- crunchy-postgres
3750
# Postgres Cluster resource values:
3851
pgmonitor:
3952
enabled: false

0 commit comments

Comments
 (0)