-
-
Save ajayk/4d965f6943478e00f1febacf50e3a8ca to your computer and use it in GitHub Desktop.
Revisions
-
ricjcosme created this gist
Sep 13, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ DUMP // pod-name name of the postgres pod // postgres-user database user that is able to access the database // database-name name of the database kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql RESTORE // pod-name name of the postgres pod // postgres-user database user that is able to access the database // database-name name of the database cat database.sql | kubectl exec -i [pod-name] -- psql -U [postgres-user] -d [database-name]