Skip to content

Simple Backups for Persisting Volumes #196

Answered by vitobotta
creib asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry for the delay. To use my image first create a secret with both the Postgres password and the S3 credentials:

apiVersion: v1
kind: Secret
metadata:
  name: s3-postgres-backup
  namespace: postgres
type: Opaque
stringData:
  POSTGRES_PASSWORD: ...
  S3_ACCESS_KEY_ID: ...
  S3_BUCKET: ...
  S3_ENDPOINT: https://..
  S3_REGION: ...
  S3_SECRET_ACCESS_KEY: ...

Then create a cronjob for each databaase

apiVersion: batch/v1
kind: CronJob
metadata:
  name: postgres-backup-<DATABASE_NAME>
  namespace: postgres
spec:
  concurrencyPolicy: Allow
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - env:
            - name: SLACK_…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@vitobotta
Comment options

@vitobotta
Comment options

@creib
Comment options

@vitobotta
Comment options

Answer selected by creib
@creib
Comment options

@vitobotta
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants