Skip to content

Commit

Permalink
Merge pull request #106 from projectsyn/bug/backup-command
Browse files Browse the repository at this point in the history
Fix backup command for builtin PostgreSQL DB
  • Loading branch information
glrf authored Dec 16, 2021
2 parents e172449 + 38c0448 commit 04398f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 6 additions & 2 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ parameters:
registry: quay.io
# TODO: Rename master to primary when upgrading to Postgres 11 https://github.com/bitnami/charts/commit/7eabc85fd4fae43127228a22829c7ce3fe85c389
master:
annotations:
k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump'
podAnnotations:
# Annotations to support both K8up v1 and v2
k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean'
k8up.syn.tools/file-extension: .sql
k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER" PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean'
k8up.io/file-extension: .sql
labels: ${keycloak:labels}
volumePermissions:
enabled: ${keycloak:database:tls:enabled}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER"
PGPASSWORD="$POSTGRES_PASSWORD" pg_dump'
annotations: null
labels:
app.kubernetes.io/component: keycloak
app.kubernetes.io/instance: builtin
Expand All @@ -21,6 +19,13 @@ spec:
serviceName: keycloak-postgresql-headless
template:
metadata:
annotations:
k8up.io/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER"
PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean'
k8up.io/file-extension: .sql
k8up.syn.tools/backupcommand: sh -c 'PGDATABASE="$POSTGRES_DB" PGUSER="$POSTGRES_USER"
PGPASSWORD="$POSTGRES_PASSWORD" pg_dump --clean'
k8up.syn.tools/file-extension: .sql
labels:
app.kubernetes.io/instance: keycloak
app.kubernetes.io/managed-by: Helm
Expand Down

0 comments on commit 04398f8

Please sign in to comment.