From 1d2fb0091f8d23f07e7c1900d19b0ebeb1ec6249 Mon Sep 17 00:00:00 2001 From: Henning Jacobs Date: Mon, 15 May 2017 18:09:00 +0200 Subject: [PATCH] how to connect via psql (#15) --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 934ac269d..3d2c01b39 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,17 @@ permissions there). ### Create a new spilo cluster $ kubectl --context minikube create -f manifests/testpostgresql.yaml - + ### Watch Pods being created $ kubectl --context minikube get pods -w --show-labels + +### Connect to PostgreSQL + +We can use the generated secret of the `postgres` robot user to connect to our `acid-testcluster` master running in Minikube: + + $ export HOST_PORT=$(minikube service acid-testcluster --url | sed 's,.*/,,') + $ export PGHOST=$(echo $HOST_PORT | cut -d: -f 1) + $ export PGPORT=$(echo $HOST_PORT | cut -d: -f 2) + $ export PGPASSWORD=$(kubectl --context minikube get secret postgres.acid-testcluster.credentials.postgresql.acid.zalan.do -o 'jsonpath={.data.password}' | base64 -d) + $ psql -U postgres