Table of Contents |
---|
PostgreSQL
Default Helm Chart
https://github.com/helm/charts/tree/master/stable/postgresql
Code Block | ||
---|---|---|
| ||
ubuntu@ip-172-31-27-4:~$ sudo helm install --name pgstg stable/postgresql
NAME: pgstg
LAST DEPLOYED: Sat Apr 27 21:51:58 2019
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/Secret
NAME TYPE DATA AGE
pgstg-postgresql Opaque 1 0s
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
pgstg-postgresql-headless ClusterIP None <none> 5432/TCP 0s
pgstg-postgresql ClusterIP 10.43.163.107 <none> 5432/TCP 0s
==> v1beta2/StatefulSet
NAME DESIRED CURRENT AGE
pgstg-postgresql 1 1 0s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
pgstg-postgresql-0 0/1 Pending 0 0s
NOTES:
** Please be patient while the chart is being deployed **
PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:
pgstg-postgresql.default.svc.cluster.local - Read/Write connection
To get the password for "postgres" run:
export POSTGRES_PASSWORD=$(kubectl get secret --namespace default pgstg-postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)
To connect to your database run the following command:
kubectl run pgstg-postgresql-client --rm --tty -i --restart='Never' --namespace default --image docker.io/bitnami/postgresql:10.7.0 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host pgstg-postgresql -U postgres
To connect to your database from outside the cluster execute the following commands:
kubectl port-forward --namespace default svc/pgstg-postgresql 5432:5432 &
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U postgres
|
Backup
Restore
Gerrit
Config Jobs
login as default admin
...