From 6e87fd58c07cbb812faa77a9b3d244d40415cf70 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Mon, 8 Apr 2024 11:11:18 -0500 Subject: [PATCH] Untemplate. --- .../grafana/app/kustomization.yaml | 4 +- .../grafana/app/postgresCluster.yaml | 86 +++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 kubernetes/apps/observability/grafana/app/postgresCluster.yaml diff --git a/kubernetes/apps/observability/grafana/app/kustomization.yaml b/kubernetes/apps/observability/grafana/app/kustomization.yaml index cf4ddc8..fc7bc09 100644 --- a/kubernetes/apps/observability/grafana/app/kustomization.yaml +++ b/kubernetes/apps/observability/grafana/app/kustomization.yaml @@ -5,5 +5,5 @@ kind: Kustomization resources: - ./externalsecret.yaml - ./helmrelease.yaml - - ./pushsecret.yaml - - ../../../../templates/postgres-database \ No newline at end of file + - ./postgresCluster.yaml + - ./pushsecret.yaml \ No newline at end of file diff --git a/kubernetes/apps/observability/grafana/app/postgresCluster.yaml b/kubernetes/apps/observability/grafana/app/postgresCluster.yaml new file mode 100644 index 0000000..eb2aedd --- /dev/null +++ b/kubernetes/apps/observability/grafana/app/postgresCluster.yaml @@ -0,0 +1,86 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/postgres-operator.crunchydata.com/postgrescluster_v1beta1.json +apiVersion: postgres-operator.crunchydata.com/v1beta1 +kind: PostgresCluster +metadata: + name: "${APP}" +spec: + postgresVersion: 16 + dataSource: + pgbackrest: + stanza: db + configuration: + - secret: + name: pgo-s3-creds + global: + repo1-path: "/${APP}/repo1" + repo1-s3-uri-style: path + repo: + name: repo1 + s3: + bucket: "crunchy-postgres" + endpoint: "s3.hsn.dev" + region: "us-east-1" + patroni: + dynamicConfiguration: + synchronous_mode: true + postgresql: + synchronous_commit: "on" + pg_hba: + - hostnossl all all 10.244.0.0/16 md5 + - hostssl all all all md5 + instances: + - name: postgres + metadata: + labels: + app.kubernetes.io/name: pgo-${APP} + replicas: 2 + dataVolumeClaimSpec: + storageClassName: openebs-hostpath + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: "kubernetes.io/hostname" + whenUnsatisfiable: "DoNotSchedule" + labelSelector: + matchLabels: + postgres-operator.crunchydata.com/cluster: ${APP} + postgres-operator.crunchydata.com/data: postgres + users: + - name: "grafana" + databases: + - "${DB_NAME}" + options: "SUPERUSER" + password: + type: AlphaNumeric + backups: + pgbackrest: + configuration: + - secret: + name: pgo-s3-creds + global: + archive-push-queue-max: 4GiB + repo1-retention-full: "14" + repo1-retention-full-type: time + repo1-path: "/${APP}/repo1" + repo1-s3-uri-style: path + manual: + repoName: repo1 + options: + - --type=full + metadata: + labels: + app.kubernetes.io/name: pgo-${APP}-backup + repos: + - name: repo1 + schedules: + full: "0 1 * * 0" + differential: "0 1 * * 1-6" + s3: + bucket: "crunchy-postgres" + endpoint: "s3.hsn.dev" + region: "us-east-1"