Skip to content

Commit 9c86f8b

Browse files
authored
Fix conf for minikube (zalando#301)
* Bump up a Spilo version to use Patroni >= v1.4.4 ; this fixes issues with k8s 1.10 API changes * Bump up an operator version to use the new 'etcd_host' default value * Re-use 'zalando-postgres-operator' as a pod service account and add extra RBAC permissions to make it work * Document in quickstart connecting to Postgres via psql
1 parent 1352c4a commit 9c86f8b

5 files changed

+18
-7
lines changed

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,22 @@ kubectl create -f manifests/postgres-operator.yaml # deployment
3939
# create a Postgres cluster
4040
kubectl create -f manifests/minimal-postgres-manifest.yaml
4141

42+
# connect to the Postgres master via psql
43+
# operator creates the relevant k8s secret
44+
export HOST_PORT=$(minikube service acid-minimal-cluster --url | sed 's,.*/,,')
45+
export PGHOST=$(echo $HOST_PORT | cut -d: -f 1)
46+
export PGPORT=$(echo $HOST_PORT | cut -d: -f 2)
47+
export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
48+
psql -U postgres
49+
4250
# tear down cleanly
4351
minikube delete
4452
```
4553

46-
We have automated these steps for you:
54+
We have automated starting the operator and submitting the `acid-minimal-cluster` for you:
4755
```bash
4856
cd postgres-operator
4957
./run_operator_locally.sh
50-
minikube delete
5158
```
5259

5360
## Scope

manifests/configmap.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ data:
1111

1212
debug_logging: "true"
1313
workers: "4"
14-
docker_image: registry.opensource.zalan.do/acid/demospilo-10:1.3-p3
14+
docker_image: registry.opensource.zalan.do/acid/spilo-cdp-10:1.4-p8
15+
pod_service_account_name: "zalando-postgres-operator"
1516
secret_name_template: '{username}.{cluster}.credentials'
16-
# etcd_host: ""
1717
super_username: postgres
1818
enable_teams_api: "false"
1919
# enable_team_superuser: "false"
@@ -28,7 +28,7 @@ data:
2828
db_hosted_zone: db.example.com
2929
master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}'
3030
replica_dns_name_format: '{cluster}-repl.{team}.staging.{hostedzone}'
31-
enable_master_load_balancer: "false"
31+
enable_master_load_balancer: "true"
3232
enable_replica_load_balancer: "false"
3333

3434
pdb_name_format: "postgres-{cluster}-pdb"

manifests/operator-service-account-rbac.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ rules:
3737
- create
3838
- delete
3939
- get
40+
- list
41+
- patch
42+
- watch # needed if zalando-postgres-operator account is used for pods as well
4043
- apiGroups:
4144
- ""
4245
resources:
@@ -79,6 +82,7 @@ rules:
7982
- get
8083
- list
8184
- watch
85+
- patch
8286
- apiGroups:
8387
- ""
8488
resources:

manifests/postgres-operator.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
serviceAccountName: zalando-postgres-operator
1313
containers:
1414
- name: postgres-operator
15-
image: registry.opensource.zalan.do/acid/postgres-operator:4c8dfd7
15+
image: registry.opensource.zalan.do/acid/postgres-operator:1352c4a5e2f5
1616
imagePullPolicy: IfNotPresent
1717
env:
1818
# provided additional ENV vars can overwrite individual config map entries

run_operator_locally.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function start_operator(){
149149
local -r cmd="kubectl get crd | grep --quiet 'postgresqls.acid.zalan.do'"
150150
retry "$cmd" "$msg "
151151

152-
kubectl create -f manifests/complete-postgres-manifest.yaml
152+
kubectl create -f manifests/minimal-postgres-manifest.yaml
153153
}
154154

155155

0 commit comments

Comments
 (0)