Skip to content
Snippets Groups Projects
Commit 1a0adda9 authored by Felix Kunde's avatar Felix Kunde
Browse files

update db connection part in user docs

parent 313db7d1
No related tags found
No related merge requests found
......@@ -43,13 +43,25 @@ $ kubectl get pods -w --show-labels
## Connect to PostgreSQL
We can use the generated secret of the `postgres` robot user to connect to our `acid-minimal-cluster` master running in Minikube:
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
our test cluster.
```bash
# get name of master pod of acid-minimal-cluster
export PGMASTER=$(kubectl get pods -o jsonpath={.items..metadata.name} -l application=spilo,version=acid-minimal-cluster,spilo-role=master)
# set up port forward
kubectl port-forward $PGMASTER 6432:5432
```
Open another CLI and connect to the database. Use the generated secret of the
`postgres` robot user to connect to our `acid-minimal-cluster` master running
in Minikube:
```bash
$ export PGHOST=db_host
$ export PGPORT=db_port
$ export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
$ psql -U postgres
$ psql -U postgres -p 6432
```
# Defining database roles in the operator
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment