diff --git a/manifests/postgres-instance.yaml b/manifests/postgres-instance.yaml index d503cbb..9249405 100644 --- a/manifests/postgres-instance.yaml +++ b/manifests/postgres-instance.yaml @@ -11,12 +11,12 @@ metadata: # namespace in k8s where the pods will be created namespace: zalando-postgres spec: - dockerImage: registry.opensource.zalan.do/acid/spilo-11:1.6-p1 + dockerImage: registry.opensource.zalan.do/acid/spilo-cdp-12:1.6-p16 # required parameter from patroni teamId: "Postgres" # size and accessmode(=defined in storageclass) for persistent volume claim volume: - size: 15Gi + size: 5Gi storageClass: standard # number of pods # 1 is master, others replicas @@ -32,27 +32,29 @@ spec: foo: zalando # dbname: owner # needed for shared_memory, in docker default=64mb enableShmVolume: true + enableMasterLoadBalancer: true + enableReplicaLoadBalancer: true allowedSourceRanges: # load balancers' source ranges for both master and replica services - 192.168.0.0/16 postgresql: - version: "11" + version: "12" # parameters for postgresql.conf # can be edited after kubectl apply for example and restart spilo service parameters: listen_addresses: '*' - shared_buffers: "128MB" - max_connections: "100" + shared_buffers: "32MB" + max_connections: "10" log_statement: "all" log_destination: "stderr" log_directory: "/var/log/postgresql" # define the minimum and limit of resources of an postgres database container resources: requests: - cpu: 100m - memory: 275Mi + cpu: 10m + memory: 100Mi limits: - cpu: 300m - memory: 300Mi + cpu: 500m + memory: 500Mi # parameters for initializing database patroni: initdb: @@ -63,5 +65,4 @@ spec: # entries for host-based access file in postgres pg_hba: - hostssl all all 0.0.0.0/0 scram-sha-256 - - host all all 0.0.0.0/0 scram-sha-256 - - host all all 0.0.0.0/0 md5 \ No newline at end of file + - host all all 0.0.0.0/0 scram-sha-256 \ No newline at end of file diff --git a/manifests/postgres-operator.yaml b/manifests/postgres-operator.yaml index 5561024..93b9cc4 100644 --- a/manifests/postgres-operator.yaml +++ b/manifests/postgres-operator.yaml @@ -21,7 +21,7 @@ spec: # every postgres-operator Deployment Pod contains one container containers: - name: postgres-operator - image: registry.opensource.zalan.do/acid/postgres-operator:latest + image: registry.opensource.zalan.do/acid/postgres-operator:v1.3.1 imagePullPolicy: IfNotPresent # set requested and limited resources for the container resources: diff --git a/reset_postgres_operator_setup.sh b/reset_postgres_operator_setup.sh index 2a710c0..af15a89 100644 --- a/reset_postgres_operator_setup.sh +++ b/reset_postgres_operator_setup.sh @@ -16,4 +16,14 @@ kubectl delete postgresql postgres-instance -n zalando-postgres sleep 3 -kubectl delete service postgres-instance postgres-instance-config postgres-instance-repl -n zalando-postgres \ No newline at end of file +kubectl delete service postgres-instance postgres-instance-config postgres-instance-repl -n zalando-postgres + +kubectl delete deployment postgres-operator -n zalando-postgres + +kubectl delete statefulset postgres-instance -n zalando-postgres + +kubectl delete pvc pgdata-postgres-instance-0 -n zalando-postgres + +kubectl delete pvc pgdata-postgres-instance-1 -n zalando-postgres + +kubectl delete pvc pgdata-postgres-instance-2 -n zalando-postgres \ No newline at end of file diff --git a/storageclasses_longhorn/default-gce.yml b/storageclasses_longhorn/default-gce.yml new file mode 100644 index 0000000..6b01d41 --- /dev/null +++ b/storageclasses_longhorn/default-gce.yml @@ -0,0 +1,8 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: standard + annotations: +provisioner: kubernetes.io/gce-pd +parameters: + type: pd-standard \ No newline at end of file