Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
postgres-operator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
zalando
postgres-operator
Commits
1a0adda9
Commit
1a0adda9
authored
6 years ago
by
Felix Kunde
Browse files
Options
Downloads
Patches
Plain Diff
update db connection part in user docs
parent
313db7d1
Branches
update-user-docs
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/user.md
+16
-4
16 additions, 4 deletions
docs/user.md
with
16 additions
and
4 deletions
docs/user.md
+
16
−
4
View file @
1a0adda9
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment