2020-05-28 17:03:29 -04:00
2020-05-28 16:58:35 -04:00
2020-05-28 16:58:35 -04:00
2020-05-28 17:03:29 -04:00

Postgres for Kube

Docker test

docker-compose up

Navigate to http://pgadmin.local

Pre-deploy

Secrets

kubectl create secret generic postgres --from-literal=POSTGRES_USER=postgres --from-literal=POSTGRES_PASSWORD=$(python -c "import secrets; print(secrets.token_urlsafe(64))")

kubectl create secret generic pgadmin --from-literal=PGADMIN_DEFAULT_EMAIL=postgres --from-literal=PGADMIN_DEFAULT_PASSWORD=$(python -c "import secrets; print(secrets.token_urlsafe(64))")

Deploy Postgres

Test

helm template postgres ./postgres | kubectl --context test-casepipeline apply -f -

Prod

helm template postgres ./postgres | kubectl --context prod-casepipeline apply -f -

Get Password

kubectl get secret postgres --output=jsonpath='{.data.POSTGRES_PASSWORD}' | base64 --decode

Deploy PG Admin

Test

prefix=<custom prefix>
helm template pgadmin ./pgadmin --set host=$prefix-pgadmin.apps-test.aws.e1.nwie.net | kubectl --context test-casepipeline apply -f -

Prod

prefix=<custom prefix>
helm template pgadmin ./pgadmin --set host=$prefix-pgadmin.apps.aws.e1.nwie.net | kubectl --context prod-casepipeline apply -f -

Login

kubectl get secret pgadmin --output=jsonpath='{.data.PGADMIN_DEFAULT_PASSWORD}' | base64 --decode
Description
Postgres and PGAdmin for Kube
Readme 36 KiB
Languages
Python 100%