Skip to content

Commit bce0a32

Browse files
author
Yannic Nevado Hidalgo
committed
upgrade setup to PostgreSQL12
1 parent 30b3994 commit bce0a32

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

manifests/postgres-instance.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ metadata:
1111
# namespace in k8s where the pods will be created
1212
namespace: zalando-postgres
1313
spec:
14-
dockerImage: registry.opensource.zalan.do/acid/spilo-11:1.6-p1
14+
dockerImage: registry.opensource.zalan.do/acid/spilo-cdp-12:1.6-p16
1515
# required parameter from patroni
1616
teamId: "Postgres"
1717
# size and accessmode(=defined in storageclass) for persistent volume claim
1818
volume:
19-
size: 15Gi
19+
size: 5Gi
2020
storageClass: standard
2121
# number of pods
2222
# 1 is master, others replicas
@@ -32,27 +32,29 @@ spec:
3232
foo: zalando # dbname: owner
3333
# needed for shared_memory, in docker default=64mb
3434
enableShmVolume: true
35+
enableMasterLoadBalancer: true
36+
enableReplicaLoadBalancer: true
3537
allowedSourceRanges: # load balancers' source ranges for both master and replica services
3638
- 192.168.0.0/16
3739
postgresql:
38-
version: "11"
40+
version: "12"
3941
# parameters for postgresql.conf
4042
# can be edited after kubectl apply for example and restart spilo service
4143
parameters:
4244
listen_addresses: '*'
43-
shared_buffers: "128MB"
44-
max_connections: "100"
45+
shared_buffers: "32MB"
46+
max_connections: "10"
4547
log_statement: "all"
4648
log_destination: "stderr"
4749
log_directory: "/var/log/postgresql"
4850
# define the minimum and limit of resources of an postgres database container
4951
resources:
5052
requests:
51-
cpu: 100m
52-
memory: 275Mi
53+
cpu: 10m
54+
memory: 100Mi
5355
limits:
54-
cpu: 300m
55-
memory: 300Mi
56+
cpu: 500m
57+
memory: 500Mi
5658
# parameters for initializing database
5759
patroni:
5860
initdb:
@@ -63,5 +65,4 @@ spec:
6365
# entries for host-based access file in postgres
6466
pg_hba:
6567
- hostssl all all 0.0.0.0/0 scram-sha-256
66-
- host all all 0.0.0.0/0 scram-sha-256
67-
- host all all 0.0.0.0/0 md5
68+
- host all all 0.0.0.0/0 scram-sha-256

manifests/postgres-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
# every postgres-operator Deployment Pod contains one container
2222
containers:
2323
- name: postgres-operator
24-
image: registry.opensource.zalan.do/acid/postgres-operator:latest
24+
image: registry.opensource.zalan.do/acid/postgres-operator:v1.3.1
2525
imagePullPolicy: IfNotPresent
2626
# set requested and limited resources for the container
2727
resources:

reset_postgres_operator_setup.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,14 @@ kubectl delete postgresql postgres-instance -n zalando-postgres
1616

1717
sleep 3
1818

19-
kubectl delete service postgres-instance postgres-instance-config postgres-instance-repl -n zalando-postgres
19+
kubectl delete service postgres-instance postgres-instance-config postgres-instance-repl -n zalando-postgres
20+
21+
kubectl delete deployment postgres-operator -n zalando-postgres
22+
23+
kubectl delete statefulset postgres-instance -n zalando-postgres
24+
25+
kubectl delete pvc pgdata-postgres-instance-0 -n zalando-postgres
26+
27+
kubectl delete pvc pgdata-postgres-instance-1 -n zalando-postgres
28+
29+
kubectl delete pvc pgdata-postgres-instance-2 -n zalando-postgres
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
kind: StorageClass
2+
apiVersion: storage.k8s.io/v1
3+
metadata:
4+
name: standard
5+
annotations:
6+
provisioner: kubernetes.io/gce-pd
7+
parameters:
8+
type: pd-standard

0 commit comments

Comments
 (0)