Verified Commit fbac201c authored by Hugo's avatar Hugo
Browse files

dump restore

parent b1f52212
apiVersion: batch/v1
kind: Job
metadata:
labels:
application: spilo-logical-backup
job-name: keycloak-dump
name: keycloak-dump
spec:
backoffLimit: 6
completions: 1
parallelism: 1
selector:
matchLabels:
job-name: keycloak-dump
template:
metadata:
creationTimestamp: null
labels:
application: spilo-logical-backup
job-name: keycloak-dump
spec:
containers:
- command:
- /bin/sh
- -c
args:
- psql -h pg-keycloak -p 5432 -U keycloak -c "\l";
pg_dump -h pg-keycloak -p 5432 -U keycloak -Fc keycloak | pigz | aws s3 cp - s3://test-dumps/migrations/$(date +%m-%d-%Y).sql.gz --endpoint-url=https://minio.k7.indie.host --region=default
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: password
name: keycloak.pg-keycloak.credentials.postgresql.acid.zalan.do
- name: AWS_S3_FORCE_PATH_STYLE
value: "true"
envFrom:
- secretRef:
name: test-dumps
image: registry.opensource.zalan.do/acid/logical-backup:v1.6.2
imagePullPolicy: IfNotPresent
name: logical-backup
restartPolicy: Never
apiVersion: batch/v1
kind: Job
metadata:
labels:
application: spilo-logical-backup
job-name: restore
name: restore
spec:
backoffLimit: 6
completions: 1
parallelism: 1
selector:
matchLabels:
job-name: keycloak-restore
template:
metadata:
creationTimestamp: null
labels:
application: spilo-logical-backup
job-name: keycloak-restore
spec:
containers:
- command:
- /bin/sh
- -c
args:
- aws s3 cp s3://test-dumps/migrations/$(date +%m-%d-%Y).sql.gz - --endpoint-url=https://minio.k7.indie.host --region=default | unpigz | pg_restore -d keycloak -h pg-keycloak -p 5432 -U keycloak --clean --no-owner --role=keycloak
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
key: password
name: keycloak.pg-keycloak.credentials
- name: AWS_S3_FORCE_PATH_STYLE
value: "true"
envFrom:
- secretRef:
name: test-dumps
image: registry.opensource.zalan.do/acid/logical-backup:v1.6.2
imagePullPolicy: IfNotPresent
name: logical-backup
restartPolicy: Never
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment