diff --git a/operations/deployment/crunchy-postgres/templates/PostgresCluster.yaml b/operations/deployment/crunchy-postgres/templates/PostgresCluster.yaml index 6013a01..d9135a6 100644 --- a/operations/deployment/crunchy-postgres/templates/PostgresCluster.yaml +++ b/operations/deployment/crunchy-postgres/templates/PostgresCluster.yaml @@ -87,6 +87,12 @@ spec: - name: postgres databases: - {{ template "crunchy-postgres.fullname" . }} + {{- if .Values.postgres.extraUsers.enabled }} + {{- with .Values.postgres.extraUsers.users }} + {{- toYaml . | indent 2 }} + {{- end }} + {{- end }} + backups: pgbackrest: image: {{ .Values.pgbackrest.image }} diff --git a/operations/deployment/crunchy-postgres/values.yaml b/operations/deployment/crunchy-postgres/values.yaml index c57f990..5f4830b 100644 --- a/operations/deployment/crunchy-postgres/values.yaml +++ b/operations/deployment/crunchy-postgres/values.yaml @@ -34,6 +34,19 @@ crunchyImage: artifacts.developer.gov.bc.ca/bcgov-docker-local/crunchy-postgres: # https://access.crunchydata.com/documentation/postgres-operator/v5/architecture/pgadmin4/ postgresVersion: 14 +postgres: + # List that allows an undefined amount of new users to be created + # Be sure to changed the 'crunchy-postgres' database name if you changed the fullNameOverride variable + extraUsers: + enabled: false + users: | + - name: extra-user-1 + databases: + - crunchy-postgres + options: "CREATEROLE" + - name: extra-user-2 + databases: + - crunchy-postgres # Postgres Cluster resource values: pgmonitor: enabled: false