Patroni can be accessed via port 5432 on the following DNS name from within your cluster:
{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local

To get your password for superuser or admin run:

    # admin user password
    PGPASSWORD_ADMIN=$(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.password-admin[*]}"`);echo)

    # superuser password
    PGPASSWORD_SUPERUSER=$(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.password-superuser[*]}"`);echo)

To connect to your database:

1. Run a postgres pod and connect using the psql cli:
    # login as admin
    kubectl run -i --tty --rm psql --image=postgres \
      --env "PGPASSWORD=$PGPASSWORD_ADMIN" \
      --command -- psql -U admin \
      -h {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local postgres

    # login as superuser
    kubectl run -i --tty --rm psql --image=postgres \
      --env "PGPASSWORD=$PGPASSWORD_SUPERUSER" \
      --command -- psql -U postgres \
      -h {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local postgres
