Skip to content

Commit

Permalink
[postgres] added automated backup to s3
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberdev committed May 11, 2023
1 parent 5868341 commit eca7603
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ values.yaml
apps/argocd/overlay/*.json
j*.pem
.DS_Store
.history

# Crash log files
crash.log
Expand Down
16 changes: 16 additions & 0 deletions apps/data/postgres/operator/base/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@ metadata:
name: postgresql-pod-environment
data:
ALLOW_NOSSL: "true"
WAL_S3_BUCKET: db-backups-grwtf
WAL_BUCKET_SCOPE_PREFIX: ""
WAL_BUCKET_SCOPE_SUFFIX: ""
USE_WALG_BACKUP: "true"
USE_WALG_RESTORE: "true"
BACKUP_SCHEDULE: '00 12 * * *'
AWS_S3_FORCE_PATH_STYLE: "false"
AWS_REGION: ewr1
WALG_DISABLE_S3_SSE: "true"
BACKUP_NUM_TO_RETAIN: "5"
CLONE_USE_WALG_RESTORE: "true"
CLONE_AWS_REGION: ewr1
CLONE_METHOD: CLONE_WITH_WALE
CLONE_WAL_BUCKET_SCOPE_PREFIX: ""
CLONE_WAL_S3_BUCKET: db-backups-grwtf-1
CLONE_AWS_S3_FORCE_PATH_STYLE: "false"
13 changes: 13 additions & 0 deletions apps/data/postgres/operator/base/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
kind: Secret
apiVersion: v1
metadata:
name: postgres-pod-secrets
annotations:
avp.kubernetes.io/path: "kv/data/s3"
stringData:
AWS_ACCESS_KEY_ID: <access-key-id>
AWS_SECRET_ACCESS_KEY: <secret-access-key>
AWS_ENDPOINT: <endpoint-uri>
CLONE_AWS_ENDPOINT: <access-key-id>
CLONE_AWS_ACCESS_KEY_ID: <secret-access-key>
CLONE_AWS_SECRET_ACCESS_KEY: <endpoint-uri>
1 change: 1 addition & 0 deletions apps/data/postgres/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ bases:
- base/rb.yaml
- base/cm.yaml
- base/svc.yaml
- base/secret.yaml
patchesStrategicMerge:
- overlay/ui-deployment.yaml
- overlay/ui-ingress.yaml
Expand Down
1 change: 1 addition & 0 deletions apps/data/postgres/operator/overlay/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ data:
# enable_init_containers: "true"
# enable_lazy_spilo_upgrade: "false"
# enable_pod_antiaffinity: "false"
pod_environment_secret: "databases/postgres-pod-secrets"
pod_environment_configmap: "databases/postgresql-pod-environment"
# enable_pod_disruption_budget: "true"
# enable_postgres_team_crd: "false"
Expand Down

0 comments on commit eca7603

Please sign in to comment.