This commit is contained in:
welld1
2020-05-28 16:58:35 -04:00
commit 118ea1b5c2
15 changed files with 312 additions and 0 deletions

53
README.md Normal file
View File

@@ -0,0 +1,53 @@
# Postgres for Kube
## Pre-deploy
### Secrets
```bash
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
```bash
helm template postgres ./postgres | kubectl --context test-casepipeline apply -f -
```
### Prod
```bash
helm template postgres ./postgres | kubectl --context prod-casepipeline apply -f -
```
### Get Password
```bash
kubectl get secret postgres --output=jsonpath='{.data.POSTGRES_PASSWORD}' | base64 --decode
```
## Deploy PG Admin
### Test
```bash
prefix=<custom prefix>
helm template pgadmin ./pgadmin --set host=$prefix-pgadmin.apps-test.aws.e1.nwie.net | kubectl --context test-casepipeline apply -f -
```
### Prod
```bash
prefix=<custom prefix>
helm template pgadmin ./pgadmin --set host=$prefix-pgadmin.apps.aws.e1.nwie.net | kubectl --context prod-casepipeline apply -f -
```
### Login
```bash
kubectl get secret pgadmin --output=jsonpath='{.data.PGADMIN_DEFAULT_PASSWORD}' | base64 --decode
```