Docker image extends the bitnami WAL-G Image and adds envdir utility.
$ # To use in k8s, we can map a configmap or secret as volumn to `/etc/wal-e.d/env`
$ mkdir -p /etc/wal-e.d/env
$ echo "secret-key-content" > /etc/wal-e.d/env/AWS_SECRET_ACCESS_KEY
$ echo "access-key" > /etc/wal-e.d/env/AWS_ACCESS_KEY_ID
$ echo 's3://some-bucket/directory/or/whatever' > \
/etc/wal-e.d/env/WALE_S3_PREFIX
$ /etc/paenvdir /etc/wal-e.d/env wal-g backup-push
# add user record in /etc/passwd for user 1001 as wal-g
# optional; required when call `wal-g backup-push` remotely to connect to postgresql
$ /usr/local/bin/adduser.sh
$ /usr/bin/envdir /etc/wal-g.d/env /usr/local/bin/wal-g backup-push
$ /usr/bin/envdir /etc/wal-g.d/env /usr/local/bin/wal-g delete --confirm retain FULL 7
wal-g supports creating base backup remotely via postgresql base backup protocol.
The protocol requries:
- a postgresql account with
replication
permission. - an entry with
database
column set to keywordreplication
in pg_hba.conf allowsreplication
connection. e.g.
host replication all 0.0.0.0/0 md5