Skip to content

Commit 2b45478

Browse files
authored
add host info to connection docs (zalando#1319)
1 parent 258799b commit 2b45478

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/user.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,26 +71,26 @@ kubectl describe postgresql acid-minimal-cluster
7171
## Connect to PostgreSQL
7272

7373
With a `port-forward` on one of the database pods (e.g. the master) you can
74-
connect to the PostgreSQL database. Use labels to filter for the master pod of
75-
our test cluster.
74+
connect to the PostgreSQL database from your machine. Use labels to filter for
75+
the master pod of our test cluster.
7676

7777
```bash
7878
# get name of master pod of acid-minimal-cluster
79-
export PGMASTER=$(kubectl get pods -o jsonpath={.items..metadata.name} -l application=spilo,cluster-name=acid-minimal-cluster,spilo-role=master)
79+
export PGMASTER=$(kubectl get pods -o jsonpath={.items..metadata.name} -l application=spilo,cluster-name=acid-minimal-cluster,spilo-role=master -n default)
8080

8181
# set up port forward
82-
kubectl port-forward $PGMASTER 6432:5432
82+
kubectl port-forward $PGMASTER 6432:5432 -n default
8383
```
8484

85-
Open another CLI and connect to the database. Use the generated secret of the
86-
`postgres` robot user to connect to our `acid-minimal-cluster` master running
87-
in Minikube. As non-encrypted connections are rejected by default set the SSL
88-
mode to require:
85+
Open another CLI and connect to the database using e.g. the psql client.
86+
When connecting with the `postgres` user read its password from the K8s secret
87+
which was generated when creating the `acid-minimal-cluster`. As non-encrypted
88+
connections are rejected by default set the SSL mode to `require`:
8989

9090
```bash
9191
export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
9292
export PGSSLMODE=require
93-
psql -U postgres -p 6432
93+
psql -U postgres -h localhost -p 6432
9494
```
9595

9696
## Defining database roles in the operator

0 commit comments

Comments
 (0)