Closed ccremer closed 2 years ago
For review: If you want to verify that restoration works, follow roughly this procedure:
make clean
-> ensure that there's no existing backups in Miniomakelocal-install install-samples s3-credentials
*/3 * * * *
) (e.g. with kubectl edit)$ kubectl exec -i -t -n sv-postgresql-s-evident-yellowjacket-f9f2 postgresql-0 -c postgresql -- sh -c "clear; (bash || ash || sh)"
$ (inside container) PGPASSWORD=$POSTGRES_PASSWORD psql -U $POSTGRES_USER
$ (inside psql) CREATE TABLE phonebook(phone VARCHAR(32), firstname VARCHAR(32), lastname VARCHAR(32), address VARCHAR(64));
$ (inside psql) INSERT INTO phonebook(phone, firstname, lastname, address) VALUES('+1 123 456 7890', 'John', 'Doe', 'North America');
$ (inside psql) SELECT * FROM phonebook ORDER BY lastname;
phone | firstname | lastname | address
-----------------+-----------+----------+---------------
+1 123 456 7890 | John | Doe | North America
restic dump --quiet ${SNAPSHOT_ID} /${deployment_namespace}-postgresql.sql
$ (inside psql) INSERT INTO phonebook(phone, firstname, lastname, address) VALUES('+1 123 456 7890', 'Hans', 'Muster', 'Europe');
$ (inside psql) SELECT * FROM phonebook ORDER BY lastname;
phone | firstname | lastname | address
-----------------+-----------+----------+---------------
+1 123 456 7890 | John | Doe | North America
+1 123 456 7890 | Hans | Muster | Europe
$ (inside psql) SELECT * FROM phonebook ORDER BY lastname;
phone | firstname | lastname | address
-----------------+-----------+----------+---------------
+1 123 456 7890 | John | Doe | North America
Converting back to draft. I noticed that as of now, only the primary database (as defined by $POSTGRES_DB) is going to be backed up (or restored). I'll first investigate a bit into possibilities that all DBs are going to be backed up and restored.
I was able to come up with a solution that is able to backup and restore all databases. This PR is now reviewable again.
Summary
pg_dump
Checklist
For Code changes
bug
,enhancement
,documentation
,change
,breaking
,dependency
as they show up in the changelogarea:operator
charts/
directory.