From 1a9fb944bad6818767cc7533a3da84a2aad961ed Mon Sep 17 00:00:00 2001 From: Pravesh Kumar Date: Mon, 4 Nov 2024 15:50:07 -0800 Subject: [PATCH 1/2] Initial Setup Change --- kustomize/high-availability/ha-postgres.yaml | 34 +++++++++++++++---- .../high-availability/kustomization.yaml | 2 +- kustomize/install/default/image-pull.yaml | 7 ++++ kustomize/install/default/kustomization.yaml | 4 ++- .../install/rbac/cluster/service_account.yaml | 3 ++ kustomize/monitoring/kustomization.yaml | 2 +- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 kustomize/install/default/image-pull.yaml diff --git a/kustomize/high-availability/ha-postgres.yaml b/kustomize/high-availability/ha-postgres.yaml index 857bd9b7..abba021a 100644 --- a/kustomize/high-availability/ha-postgres.yaml +++ b/kustomize/high-availability/ha-postgres.yaml @@ -1,10 +1,15 @@ apiVersion: postgres-operator.crunchydata.com/v1beta1 kind: PostgresCluster metadata: - name: hippo-ha + name: crunchy-ha spec: - image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-16.3-1 - postgresVersion: 16 + service: + type: LoadBalancer + imagePullSecrets: + - name: crunchyreg + image: registry.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.7-5.6.0-2 + # image: registry.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.8-5.6.2-0 + postgresVersion: 15 instances: - name: pgha1 replicas: 2 @@ -22,11 +27,12 @@ spec: topologyKey: kubernetes.io/hostname labelSelector: matchLabels: - postgres-operator.crunchydata.com/cluster: hippo-ha + postgres-operator.crunchydata.com/cluster: crunchy-ha postgres-operator.crunchydata.com/instance-set: pgha1 backups: pgbackrest: - image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.51-1 + image: registry.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-5.6.0-2 + # image: registry.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-5.6.2-0 repos: - name: repo1 volume: @@ -36,9 +42,13 @@ spec: resources: requests: storage: 1Gi + monitoring: + pgmonitor: + exporter: + image: registry.crunchydata.com/crunchydata/crunchy-postgres-exporter:ubi8-5.6.0-2 proxy: pgBouncer: - image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1 + image: registry.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.22-1 replicas: 2 affinity: podAntiAffinity: @@ -48,5 +58,15 @@ spec: topologyKey: kubernetes.io/hostname labelSelector: matchLabels: - postgres-operator.crunchydata.com/cluster: hippo-ha + postgres-operator.crunchydata.com/cluster: crunchy-ha postgres-operator.crunchydata.com/role: pgbouncer + patroni: + dynamicConfiguration: + postgresql: + parameters: + max_parallel_workers: 2 + max_worker_processes: 2 + shared_buffers: 1GB + work_mem: 2MB + pg_hba: + - "hostssl all all all scram-sha-256" \ No newline at end of file diff --git a/kustomize/high-availability/kustomization.yaml b/kustomize/high-availability/kustomization.yaml index ff4b909c..1a55742a 100644 --- a/kustomize/high-availability/kustomization.yaml +++ b/kustomize/high-availability/kustomization.yaml @@ -1,7 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: postgres-operator +namespace: pg-operator resources: - ha-postgres.yaml diff --git a/kustomize/install/default/image-pull.yaml b/kustomize/install/default/image-pull.yaml new file mode 100644 index 00000000..35561763 --- /dev/null +++ b/kustomize/install/default/image-pull.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: crunchyreg +data: + .dockerconfigjson: '{"auths":{"registry.crunchydata.com":{"username":"pkumar@upgrade.com","password":"9om8fRamew34q=B","email":"pkumar@upgrade.com","auth":"cGt1bWFyQHVwZ3JhZGUuY29tOjlvbThmUmFtZXczNHE9Qg=="}}}' +type: kubernetes.io/dockerconfigjson diff --git a/kustomize/install/default/kustomization.yaml b/kustomize/install/default/kustomization.yaml index 1583c865..2d5a255a 100644 --- a/kustomize/install/default/kustomization.yaml +++ b/kustomize/install/default/kustomization.yaml @@ -1,6 +1,6 @@ kind: Kustomization -namespace: postgres-operator +namespace: pg-operator labels: - includeSelectors: false @@ -14,9 +14,11 @@ labels: postgres-operator.crunchydata.com/control-plane: postgres-operator resources: +- image-pull.yaml - ../crd - ../rbac/cluster - ../manager + components: - ../components/images-by-tag diff --git a/kustomize/install/rbac/cluster/service_account.yaml b/kustomize/install/rbac/cluster/service_account.yaml index 364f7971..3bf992ac 100644 --- a/kustomize/install/rbac/cluster/service_account.yaml +++ b/kustomize/install/rbac/cluster/service_account.yaml @@ -3,3 +3,6 @@ apiVersion: v1 kind: ServiceAccount metadata: name: pgo +imagePullSecrets: +- name: crunchyreg + diff --git a/kustomize/monitoring/kustomization.yaml b/kustomize/monitoring/kustomization.yaml index 15010e47..ff0aaf03 100644 --- a/kustomize/monitoring/kustomization.yaml +++ b/kustomize/monitoring/kustomization.yaml @@ -1,6 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: postgres-operator +namespace: crunchy-poc-monitoring labels: - includeSelectors: true From c60c51e18f0642044f02ad2bbd234a2f7fdac6ce Mon Sep 17 00:00:00 2001 From: Pravesh Kumar Date: Wed, 20 Nov 2024 23:04:39 -0800 Subject: [PATCH 2/2] crunchy-poc configs --- kustomize/high-availability/ha-postgres.yaml | 38 ++++++++++++++----- .../high-availability/kustomization.yaml | 2 +- kustomize/install/default/image-pull.yaml | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/kustomize/high-availability/ha-postgres.yaml b/kustomize/high-availability/ha-postgres.yaml index abba021a..9d5a30e6 100644 --- a/kustomize/high-availability/ha-postgres.yaml +++ b/kustomize/high-availability/ha-postgres.yaml @@ -1,12 +1,15 @@ apiVersion: postgres-operator.crunchydata.com/v1beta1 kind: PostgresCluster metadata: - name: crunchy-ha + name: crunchy-poc spec: service: type: LoadBalancer + metadata: + annotations: + service.beta.kubernetes.io/aws-load-balancer-internal: "true" imagePullSecrets: - - name: crunchyreg + - name: crtestreg image: registry.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.7-5.6.0-2 # image: registry.crunchydata.com/crunchydata/crunchy-postgres:ubi8-15.8-5.6.2-0 postgresVersion: 15 @@ -27,7 +30,7 @@ spec: topologyKey: kubernetes.io/hostname labelSelector: matchLabels: - postgres-operator.crunchydata.com/cluster: crunchy-ha + postgres-operator.crunchydata.com/cluster: crunchy-poc postgres-operator.crunchydata.com/instance-set: pgha1 backups: pgbackrest: @@ -58,15 +61,30 @@ spec: topologyKey: kubernetes.io/hostname labelSelector: matchLabels: - postgres-operator.crunchydata.com/cluster: crunchy-ha + postgres-operator.crunchydata.com/cluster: crunchy-poc postgres-operator.crunchydata.com/role: pgbouncer + resources: + requests: + ephemeral-storage: "2Gi" # Request 2GiB of ephemeral storage + limits: + ephemeral-storage: "4Gi" # Limit usage to 4GiB of ephemeral storage + + # patroni: + # dynamicConfiguration: + # postgresql: + # parameters: + # max_parallel_workers: 2 + # max_worker_processes: 2 + # shared_buffers: 1GB + # work_mem: 2MB + # pg_hba: + # - "hostssl all all all scram-sha-256" patroni: dynamicConfiguration: postgresql: parameters: - max_parallel_workers: 2 - max_worker_processes: 2 - shared_buffers: 1GB - work_mem: 2MB - pg_hba: - - "hostssl all all all scram-sha-256" \ No newline at end of file + max_parallel_workers: 8 + max_worker_processes: 8 + wal_sender_timeout: 10min + shared_buffers: 128MB + work_mem: 4MB diff --git a/kustomize/high-availability/kustomization.yaml b/kustomize/high-availability/kustomization.yaml index 1a55742a..b7e9bf38 100644 --- a/kustomize/high-availability/kustomization.yaml +++ b/kustomize/high-availability/kustomization.yaml @@ -1,7 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: pg-operator +namespace: crunchy-poc resources: - ha-postgres.yaml diff --git a/kustomize/install/default/image-pull.yaml b/kustomize/install/default/image-pull.yaml index 35561763..b6be976e 100644 --- a/kustomize/install/default/image-pull.yaml +++ b/kustomize/install/default/image-pull.yaml @@ -3,5 +3,5 @@ kind: Secret metadata: name: crunchyreg data: - .dockerconfigjson: '{"auths":{"registry.crunchydata.com":{"username":"pkumar@upgrade.com","password":"9om8fRamew34q=B","email":"pkumar@upgrade.com","auth":"cGt1bWFyQHVwZ3JhZGUuY29tOjlvbThmUmFtZXczNHE9Qg=="}}}' + .dockerconfigjson: eyJhdXRocyI6eyJyZWdpc3RyeS5jcnVuY2h5ZGF0YS5jb20iOnsidXNlcm5hbWUiOiJwa3VtYXJAdXBncmFkZS5jb20iLCJwYXNzd29yZCI6IjlvbThmUmFtZXczNHE9QiIsImVtYWlsIjoicGt1bWFyQHVwZ3JhZGUuY29tIiwiYXV0aCI6ImNHdDFiV0Z5UUhWd1ozSmhaR1V1WTI5dE9qbHZiVGhtVW1GdFpYY3pOSEU5UWc9PSJ9fX0= type: kubernetes.io/dockerconfigjson