This image is based on the latest Ubuntu and contains PostgreSQL client utilities including psql, pg_dump and pg_dumpall but also aws-cli 2 to be able to dump and restore from s3.
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: pg-dump-s3
spec:
schedule: '3 3 * * *'
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
containers:
- name: pg-dump-s3
image: ectobit/pg-dump-s3
imagePullPolicy: Always
env:
- name: PGHOST
value: postgresql
- name: PGUSER
value: postgres
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql
key: postgres-password
- name: DBS
value: auth_service,other_service
- name: AWS_ACCESS_KEY_ID
value: { { requiredEnv "S3_ACCESS_KEY_ID" } }
- name: AWS_SECRET_ACCESS_KEY
value: { { requiredEnv "S3_SECRET_ACCESS_KEY" } }
- name: S3_BUCKET
value: bucket/sub-bucket
restartPolicy: OnFailure
ttlSecondsAfterFinished: 172800
Content type
Image
Digest
sha256:4baaa1684…
Size
86.2 MB
Last updated
almost 4 years ago
docker pull ectobit/pg-dump-s3