Source https://cloudnative-pg.io/
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm upgrade --install postgres-operator -n postgres-operator cnpg/cloudnative-pg
Verify install
kubectl get po -n postgres-operator
Install container
kubectl apply -f postgres.yaml
# get initial password
kubectl get secret -n postgres pgcluster-app -o yaml
Use cluster
## dba
kubectl exec -it -n postgres pgcluster-2 -- psql
## app
kubectl --namespace postgres exec --stdin --tty services/p gcluster-rw -- bash
Uninstall cluster
kubectl delete -f postgres.yaml
# standalone install
helm upgrade --install pgcluster -n postgres cnpg/cluster --values pgcluster.yaml
helm test --namespace postgres pgcluster
# standalone uninstall
helm uninstall pgcluster -n postgres
helm uninstall postgres-operator -n postgres-operator