Skip to content

Commit 998ed57

Browse files
author
Yannic Nevado Hidalgo
committed
add using patronictl on pod, change apiversion for loadbalancer
1 parent 7b8cb2e commit 998ed57

File tree

6 files changed

+24
-6
lines changed

6 files changed

+24
-6
lines changed

create_operator_setup.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ kubectl create -f manifests/operator-service-account-rbac.yaml --namespace zalan
88

99
kubectl create -f manifests/postgres-operator.yaml --namespace zalando-postgres
1010

11-
sleep 5
11+
sleep 10
1212

1313
kubectl get pod -l name=postgres-operator --namespace zalando-postgres
1414

15-
kubectl create -f manifests/minimal-postgres-manifest.yaml --namespace zalando-postgres
15+
kubectl create -f manifests/minimal-postgres-manifest.yaml --namespace zalando-postgres
16+
17+
sleep 10
18+
19+
kubectl get postgresql --namespace zalando-postgres
20+
21+
kubectl get pods -l application=spilo -L spilo-role --namespace zalando-postgres
22+
23+
kubectl get svc -l application=spilo -L spilo-role --namespace zalando-postgres

loadbalancer/metallb.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ roleRef:
143143
kind: Role
144144
name: leader-election
145145
---
146-
apiVersion: apps/v1beta2
146+
apiVersion: apps/v1
147147
kind: DaemonSet
148148
metadata:
149149
namespace: metallb-system
@@ -196,7 +196,7 @@ spec:
196196
add:
197197
- net_raw
198198
---
199-
apiVersion: apps/v1beta2
199+
apiVersion: apps/v1
200200
kind: Deployment
201201
metadata:
202202
namespace: metallb-system

manifests/minimal-postgres-manifest.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
# parameters for postgresql.conf
3838
# can be edited after kubectl apply for example and restart spilo service
3939
parameters:
40+
listen_addresses: '*'
4041
shared_buffers: "128MB"
4142
max_connections: "10"
4243
log_statement: "all"

manifests/standby-manifest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spec:
99
size: 1Gi
1010
numberOfInstances: 1
1111
postgresql:
12-
version: "10"
12+
version: "11"
1313
# Make this a standby cluster and provide the s3 bucket path of source cluster for continuous streaming.
1414
standby:
1515
#s3_wal_path: "s3://path/to/bucket/containing/wal/of/source/cluster/"

patroni.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Using Patroni Service
2+
3+
1. Execute Shell on Pod
4+
1. List all cluster members
5+
2.1 `patronictl -c /home/postgres/.config/patroni/patronictl.yaml list`
6+
1. Execute switchover
7+
3.1 `patronictl -c /home/postgres/.config/patroni/patronictl.yaml switchover`

reset_postgres_operator_setup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ kubectl delete postgresql acid-minimal-cluster --namespace zalando-postgres
1616

1717
kubectl delete service acid-minimal-cluster acid-minimal-cluster-repl -n zalando-postgres
1818

19-
kubectl delete poddisruptionbudgets postgres-acid-minimal-cluster-pdb -n zalando-postgres
19+
kubectl delete poddisruptionbudgets postgres-acid-minimal-cluster-pdb -n zalando-postgres
20+
21+
kubectl delete pvc pgdata-acid-minimal-cluster-0 pgdata-acid-minimal-cluster-1 -n zalando-postgres

0 commit comments

Comments
 (0)