add host info to connection docs (#1319)
This commit is contained in:
parent
258799b420
commit
2b45478f3a
18
docs/user.md
18
docs/user.md
|
|
@ -71,26 +71,26 @@ kubectl describe postgresql acid-minimal-cluster
|
||||||
## Connect to PostgreSQL
|
## Connect to PostgreSQL
|
||||||
|
|
||||||
With a `port-forward` on one of the database pods (e.g. the master) you can
|
With a `port-forward` on one of the database pods (e.g. the master) you can
|
||||||
connect to the PostgreSQL database. Use labels to filter for the master pod of
|
connect to the PostgreSQL database from your machine. Use labels to filter for
|
||||||
our test cluster.
|
the master pod of our test cluster.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# get name of master pod of acid-minimal-cluster
|
# get name of master pod of acid-minimal-cluster
|
||||||
export PGMASTER=$(kubectl get pods -o jsonpath={.items..metadata.name} -l application=spilo,cluster-name=acid-minimal-cluster,spilo-role=master)
|
export PGMASTER=$(kubectl get pods -o jsonpath={.items..metadata.name} -l application=spilo,cluster-name=acid-minimal-cluster,spilo-role=master -n default)
|
||||||
|
|
||||||
# set up port forward
|
# set up port forward
|
||||||
kubectl port-forward $PGMASTER 6432:5432
|
kubectl port-forward $PGMASTER 6432:5432 -n default
|
||||||
```
|
```
|
||||||
|
|
||||||
Open another CLI and connect to the database. Use the generated secret of the
|
Open another CLI and connect to the database using e.g. the psql client.
|
||||||
`postgres` robot user to connect to our `acid-minimal-cluster` master running
|
When connecting with the `postgres` user read its password from the K8s secret
|
||||||
in Minikube. As non-encrypted connections are rejected by default set the SSL
|
which was generated when creating the `acid-minimal-cluster`. As non-encrypted
|
||||||
mode to require:
|
connections are rejected by default set the SSL mode to `require`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
|
export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
|
||||||
export PGSSLMODE=require
|
export PGSSLMODE=require
|
||||||
psql -U postgres -p 6432
|
psql -U postgres -h localhost -p 6432
|
||||||
```
|
```
|
||||||
|
|
||||||
## Defining database roles in the operator
|
## Defining database roles in the operator
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue