Skip to content
Snippets Groups Projects
Unverified Commit 9c86f8bd authored by zerg-junior's avatar zerg-junior Committed by GitHub
Browse files

Fix conf for minikube (#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 
parent 1352c4a5
Branches
Tags
No related merge requests found
...@@ -39,15 +39,22 @@ kubectl create -f manifests/postgres-operator.yaml # deployment ...@@ -39,15 +39,22 @@ kubectl create -f manifests/postgres-operator.yaml # deployment
# create a Postgres cluster # create a Postgres cluster
kubectl create -f manifests/minimal-postgres-manifest.yaml kubectl create -f manifests/minimal-postgres-manifest.yaml
# connect to the Postgres master via psql
# operator creates the relevant k8s secret
export HOST_PORT=$(minikube service acid-minimal-cluster --url | sed 's,.*/,,')
export PGHOST=$(echo $HOST_PORT | cut -d: -f 1)
export PGPORT=$(echo $HOST_PORT | cut -d: -f 2)
export PGPASSWORD=$(kubectl get secret postgres.acid-minimal-cluster.credentials -o 'jsonpath={.data.password}' | base64 -d)
psql -U postgres
# tear down cleanly # tear down cleanly
minikube delete minikube delete
``` ```
We have automated these steps for you: We have automated starting the operator and submitting the `acid-minimal-cluster` for you:
```bash ```bash
cd postgres-operator cd postgres-operator
./run_operator_locally.sh ./run_operator_locally.sh
minikube delete
``` ```
## Scope ## Scope
......
...@@ -11,9 +11,9 @@ data: ...@@ -11,9 +11,9 @@ data:
debug_logging: "true" debug_logging: "true"
workers: "4" workers: "4"
docker_image: registry.opensource.zalan.do/acid/demospilo-10:1.3-p3 docker_image: registry.opensource.zalan.do/acid/spilo-cdp-10:1.4-p8
pod_service_account_name: "zalando-postgres-operator"
secret_name_template: '{username}.{cluster}.credentials' secret_name_template: '{username}.{cluster}.credentials'
# etcd_host: ""
super_username: postgres super_username: postgres
enable_teams_api: "false" enable_teams_api: "false"
# enable_team_superuser: "false" # enable_team_superuser: "false"
...@@ -28,7 +28,7 @@ data: ...@@ -28,7 +28,7 @@ data:
db_hosted_zone: db.example.com db_hosted_zone: db.example.com
master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}' master_dns_name_format: '{cluster}.{team}.staging.{hostedzone}'
replica_dns_name_format: '{cluster}-repl.{team}.staging.{hostedzone}' replica_dns_name_format: '{cluster}-repl.{team}.staging.{hostedzone}'
enable_master_load_balancer: "false" enable_master_load_balancer: "true"
enable_replica_load_balancer: "false" enable_replica_load_balancer: "false"
pdb_name_format: "postgres-{cluster}-pdb" pdb_name_format: "postgres-{cluster}-pdb"
......
...@@ -37,6 +37,9 @@ rules: ...@@ -37,6 +37,9 @@ rules:
- create - create
- delete - delete
- get - get
- list
- patch
- watch # needed if zalando-postgres-operator account is used for pods as well
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
...@@ -79,6 +82,7 @@ rules: ...@@ -79,6 +82,7 @@ rules:
- get - get
- list - list
- watch - watch
- patch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
......
...@@ -12,7 +12,7 @@ spec: ...@@ -12,7 +12,7 @@ spec:
serviceAccountName: zalando-postgres-operator serviceAccountName: zalando-postgres-operator
containers: containers:
- name: postgres-operator - name: postgres-operator
image: registry.opensource.zalan.do/acid/postgres-operator:4c8dfd7 image: registry.opensource.zalan.do/acid/postgres-operator:1352c4a5e2f5
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
env: env:
# provided additional ENV vars can overwrite individual config map entries # provided additional ENV vars can overwrite individual config map entries
......
...@@ -149,7 +149,7 @@ function start_operator(){ ...@@ -149,7 +149,7 @@ function start_operator(){
local -r cmd="kubectl get crd | grep --quiet 'postgresqls.acid.zalan.do'" local -r cmd="kubectl get crd | grep --quiet 'postgresqls.acid.zalan.do'"
retry "$cmd" "$msg " retry "$cmd" "$msg "
kubectl create -f manifests/complete-postgres-manifest.yaml kubectl create -f manifests/minimal-postgres-manifest.yaml
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment