From c87c7b48d843ac78245155a725c361303f840a4f Mon Sep 17 00:00:00 2001 From: Damjan Dvorsek Date: Fri, 17 Dec 2021 14:38:16 +0100 Subject: [PATCH 1/4] feat: add visfrim-db --- kustomize/postgres/add-users.yaml | 10 ++++++ kustomize/postgres/kustomization.yaml | 10 +++++- kustomize/postgres/visfrim-patch.yaml | 44 +++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 kustomize/postgres/add-users.yaml create mode 100644 kustomize/postgres/visfrim-patch.yaml diff --git a/kustomize/postgres/add-users.yaml b/kustomize/postgres/add-users.yaml new file mode 100644 index 00000000..60af7fad --- /dev/null +++ b/kustomize/postgres/add-users.yaml @@ -0,0 +1,10 @@ +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: hippo +spec: + users: + - name: rhino + databases: + - zoo + options: "SUPERUSER" diff --git a/kustomize/postgres/kustomization.yaml b/kustomize/postgres/kustomization.yaml index 249b4106..2986be1e 100644 --- a/kustomize/postgres/kustomization.yaml +++ b/kustomize/postgres/kustomization.yaml @@ -1,4 +1,12 @@ -namespace: postgres-operator +namespace: visfrim-database resources: - postgres.yaml + +patchesJson6902: +- target: + group: postgres-operator.crunchydata.com + version: v1beta1 + kind: PostgresCluster + name: hippo + path: visfrim-patch.yaml diff --git a/kustomize/postgres/visfrim-patch.yaml b/kustomize/postgres/visfrim-patch.yaml new file mode 100644 index 00000000..465e9c92 --- /dev/null +++ b/kustomize/postgres/visfrim-patch.yaml @@ -0,0 +1,44 @@ +- op: replace + path: /metadata/name + value: visfrim-db +- op: replace + path: /spec/image + value: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:centos8-13.5-3.1-0 +- op: replace + path: /spec/instances/0/dataVolumeClaimSpec/resources/requests/storage + value: 4Gi +- op: replace + path: /spec/backups/pgbackrest/repos/0/volume/volumeClaimSpec/resources/requests/storage + value: 2.5Gi +- op: add + path: /spec/users + value: [{"name": "visfrim", "databases": ["visfrim-db"], "options": "SUPERUSER"}] +- op: add + path: /spec/patroni + value: + dynamicConfiguration: + postgresql: + parameters: + max_wal_size: 100 MB +- op: replace + path: /spec/backups/pgbackrest/image + value: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.36-0 +- op: add + path: /spec/backups/pgbackrest/global + value: + repo1-retention-full: "5" + repo1-retention-full-type: time + log-level-console: debug + +- op: add + path: /spec/backups/pgbackrest/manual + value: + repoName: repo1 + options: + - --type=full +- op: add + path: /spec/backups/pgbackrest/repos/0/schedules + value: + full: "0 1 * * *" + incremental: "0 */1 * * *" + From fe098aaa7be12e2aee274ffd7df6c87f8c95360c Mon Sep 17 00:00:00 2001 From: Damjan Dvorsek Date: Fri, 17 Dec 2021 14:38:55 +0100 Subject: [PATCH 2/4] feat: add meteo-db --- .../postgres/meteo-baza/kustomization.yaml | 12 +++++ .../postgres/meteo-baza/meteo-patch.yaml | 45 +++++++++++++++++++ kustomize/postgres/meteo-baza/postgres.yaml | 27 +++++++++++ 3 files changed, 84 insertions(+) create mode 100644 kustomize/postgres/meteo-baza/kustomization.yaml create mode 100644 kustomize/postgres/meteo-baza/meteo-patch.yaml create mode 100644 kustomize/postgres/meteo-baza/postgres.yaml diff --git a/kustomize/postgres/meteo-baza/kustomization.yaml b/kustomize/postgres/meteo-baza/kustomization.yaml new file mode 100644 index 00000000..eced51f2 --- /dev/null +++ b/kustomize/postgres/meteo-baza/kustomization.yaml @@ -0,0 +1,12 @@ +namespace: meteo-database + +resources: +- postgres.yaml + +patchesJson6902: +- target: + group: postgres-operator.crunchydata.com + version: v1beta1 + kind: PostgresCluster + name: hippo + path: meteo-patch.yaml diff --git a/kustomize/postgres/meteo-baza/meteo-patch.yaml b/kustomize/postgres/meteo-baza/meteo-patch.yaml new file mode 100644 index 00000000..6650dab8 --- /dev/null +++ b/kustomize/postgres/meteo-baza/meteo-patch.yaml @@ -0,0 +1,45 @@ +- op: replace + path: /metadata/name + value: meteo-db +- op: replace + path: /spec/image + value: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:centos8-13.4-3.1-1 +- op: replace + path: /spec/instances/0/dataVolumeClaimSpec/resources/requests/storage + value: 40Gi +- op: replace + path: /spec/backups/pgbackrest/repos/0/volume/volumeClaimSpec/resources/requests/storage + value: 40Gi +- op: add + path: /spec/users + value: [{"name": "hasura", "databases": ["hasura"], "options": "SUPERUSER"}, {"name": "meteo-db", "databases": ["meteo-db"], "options": ""}] +- op: add + path: /spec/patroni + value: + dynamicConfiguration: + postgresql: + parameters: + shared_preload_libraries: timescaledb +- op: add + path: /spec/backups/pgbackrest/global + value: + repo1-retention-full: "7" + repo1-retention-full-type: time +- op: add + path: /spec/backups/pgbackrest/manual + value: + repoName: repo1 + options: + - --type=full +- op: add + path: /spec/backups/pgbackrest/repos/0/schedules + value: + full: "0 1 * * *" + incremental: "5 * * * *" + + + + + + + diff --git a/kustomize/postgres/meteo-baza/postgres.yaml b/kustomize/postgres/meteo-baza/postgres.yaml new file mode 100644 index 00000000..5e7b9dc5 --- /dev/null +++ b/kustomize/postgres/meteo-baza/postgres.yaml @@ -0,0 +1,27 @@ +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: hippo +spec: + image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.4-1 + postgresVersion: 13 + instances: + - name: instance1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 1Gi + backups: + pgbackrest: + image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.35-0 + repos: + - name: repo1 + volume: + volumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 1Gi From d139af18f03edec12be2421d2ec7c0c25fe601c6 Mon Sep 17 00:00:00 2001 From: Damjan Dvorsek Date: Fri, 17 Dec 2021 14:39:20 +0100 Subject: [PATCH 3/4] test: add testing db --- kustomize/postgres/test/kustomization.yaml | 12 ++++++++++ kustomize/postgres/test/postgres.yaml | 27 ++++++++++++++++++++++ kustomize/postgres/test/test-patch.yaml | 13 +++++++++++ 3 files changed, 52 insertions(+) create mode 100644 kustomize/postgres/test/kustomization.yaml create mode 100644 kustomize/postgres/test/postgres.yaml create mode 100644 kustomize/postgres/test/test-patch.yaml diff --git a/kustomize/postgres/test/kustomization.yaml b/kustomize/postgres/test/kustomization.yaml new file mode 100644 index 00000000..fd0f0cb5 --- /dev/null +++ b/kustomize/postgres/test/kustomization.yaml @@ -0,0 +1,12 @@ +namespace: test-bitnami-nginx + +resources: +- postgres.yaml + +patchesJson6902: +- target: + group: postgres-operator.crunchydata.com + version: v1beta1 + kind: PostgresCluster + name: hippo + path: test-patch.yaml diff --git a/kustomize/postgres/test/postgres.yaml b/kustomize/postgres/test/postgres.yaml new file mode 100644 index 00000000..5e7b9dc5 --- /dev/null +++ b/kustomize/postgres/test/postgres.yaml @@ -0,0 +1,27 @@ +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: hippo +spec: + image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:centos8-13.4-1 + postgresVersion: 13 + instances: + - name: instance1 + dataVolumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 1Gi + backups: + pgbackrest: + image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:centos8-2.35-0 + repos: + - name: repo1 + volume: + volumeClaimSpec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: 1Gi diff --git a/kustomize/postgres/test/test-patch.yaml b/kustomize/postgres/test/test-patch.yaml new file mode 100644 index 00000000..280ed99b --- /dev/null +++ b/kustomize/postgres/test/test-patch.yaml @@ -0,0 +1,13 @@ +- op: replace + path: /metadata/name + value: test-db +- op: replace + path: /spec/image + value: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:centos8-13.4-3.1-1 +- op: add + path: /spec/patroni + value: + dynamicConfiguration: + postgresql: + parameters: + shared_preload_libraries: timescaledb From 23eb47c49e7c7842ae671c96fdcd029fa57ccd0f Mon Sep 17 00:00:00 2001 From: Damjan Dvorsek Date: Fri, 24 Dec 2021 10:24:31 +0100 Subject: [PATCH 4/4] change PVC size --- kustomize/postgres/test/test-patch.yaml | 17 +++++++++++++++++ kustomize/postgres/visfrim-patch.yaml | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/kustomize/postgres/test/test-patch.yaml b/kustomize/postgres/test/test-patch.yaml index 280ed99b..3d107061 100644 --- a/kustomize/postgres/test/test-patch.yaml +++ b/kustomize/postgres/test/test-patch.yaml @@ -11,3 +11,20 @@ postgresql: parameters: shared_preload_libraries: timescaledb +- op: add + path: /spec/backups/pgbackrest/global + value: + repo1-retention-full: "7" + repo1-retention-full-type: time +- op: add + path: /spec/backups/pgbackrest/manual + value: + repoName: repo1 + options: + - --type=full +- op: add + path: /spec/backups/pgbackrest/repos/0/schedules + value: + full: "0 1 * * *" + incremental: "*/5 * * * *" + diff --git a/kustomize/postgres/visfrim-patch.yaml b/kustomize/postgres/visfrim-patch.yaml index 465e9c92..1b2d71f7 100644 --- a/kustomize/postgres/visfrim-patch.yaml +++ b/kustomize/postgres/visfrim-patch.yaml @@ -6,10 +6,10 @@ value: registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:centos8-13.5-3.1-0 - op: replace path: /spec/instances/0/dataVolumeClaimSpec/resources/requests/storage - value: 4Gi + value: 5Gi - op: replace path: /spec/backups/pgbackrest/repos/0/volume/volumeClaimSpec/resources/requests/storage - value: 2.5Gi + value: 3Gi - op: add path: /spec/users value: [{"name": "visfrim", "databases": ["visfrim-db"], "options": "SUPERUSER"}]