Closed bacongobbler closed 7 years ago
@kmala is a potential reviewer of this pull request based on my analysis of git blame
information. Thanks @bacongobbler!
@nailgun if you feel like taking a spin with this PR, please feel free to test it out.
Ok, I will test this. But if I understand it in right way, backup
script will run infinite loop. Plus it sleeps before actually doing a backup.
fixed.
Great! Is there a simple way to inject this into my kubernetes? Or I need to build and store image somewhere?
You can do so by running kubectl --namespace=deis edit deployment deis-database
.
You'll have to modify the image being used to quay.io/deisci/postgres:git-2615187
and add the preStop hook in there. Jenkins already created the image to test this PR.
Note that this image should only be used temporarily for testing purposes as we clean out the deisci
org of all images occasionally.
I tested this but it appears the script is run as root, not postgres, which causes a problem?
.82 seg=000000020000000000000010 state=complete
FATAL: role "root" does not exist
LOG: received smart shutdown request
LOG: autovacuum launcher shutting down
Also could you create a deis/charts PR for the workflow-dev chart to go with this? Some of us still test with Helm classic for a few things... 👴
good catch @mboersma. The real invocation should be gosu postgres do_backup
. I'll make that change here and PR a helm-classic change as well.
I re-tested after this gosu postgres
change and confirmed that killing a database pod kicks off the preStop
backup process. Seems ok here in simple testing.
Sorry for late reply. I broken my cluster :) Just rebuilt it (I'm new to kubernetes). @mboersma thanks for testing.
closes #108
closes #164.