From 99e405b0a57e52033589f6f00ec250a690b15b07 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 17 Jul 2024 12:55:32 +1000 Subject: [PATCH] add infra postgresql --- .../k3s-cluster/{templates => }/ingress.yaml | 0 .../env/k3s-cluster/kustomization.yaml | 11 +++++++ .../postgresql/env/k3s-cluster/values.yaml | 30 +++++++++++++++---- .../k3s-cluster/{templates => }/volume.yaml | 0 4 files changed, 36 insertions(+), 5 deletions(-) rename infrastructures/postgresql/env/k3s-cluster/{templates => }/ingress.yaml (100%) create mode 100644 infrastructures/postgresql/env/k3s-cluster/kustomization.yaml rename infrastructures/postgresql/env/k3s-cluster/{templates => }/volume.yaml (100%) diff --git a/infrastructures/postgresql/env/k3s-cluster/templates/ingress.yaml b/infrastructures/postgresql/env/k3s-cluster/ingress.yaml similarity index 100% rename from infrastructures/postgresql/env/k3s-cluster/templates/ingress.yaml rename to infrastructures/postgresql/env/k3s-cluster/ingress.yaml diff --git a/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml b/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..6301cb5 --- /dev/null +++ b/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./volume.yaml + - ./ingress.yaml +helmCharts: + - name: postgresql + repo: oci://registry-1.docker.io/bitnamicharts + version: 15.5.17 + releaseName: postgresql + valuesFile: values.yaml \ No newline at end of file diff --git a/infrastructures/postgresql/env/k3s-cluster/values.yaml b/infrastructures/postgresql/env/k3s-cluster/values.yaml index 278771c..39ebf02 100644 --- a/infrastructures/postgresql/env/k3s-cluster/values.yaml +++ b/infrastructures/postgresql/env/k3s-cluster/values.yaml @@ -1,9 +1,29 @@ auth: - postgresPassword: ${postgres_password} - username: ${username} - password: ${password} - database: ${database} - replicationPassword: ${replication_password} + postgresPassword: + valueFrom: + secretKeyRef: + name: postgresql-secrets + key: postgres_password + username: + valueFrom: + secretKeyRef: + name: postgresql-secrets + key: username + password: + valueFrom: + secretKeyRef: + name: postgresql-secrets + key: password + database: + valueFrom: + secretKeyRef: + name: postgresql-secrets + key: database + replicationPassword: + valueFrom: + secretKeyRef: + name: postgresql-secrets + key: replication_password architecture: "replication" replication: synchronousCommit: "on" diff --git a/infrastructures/postgresql/env/k3s-cluster/templates/volume.yaml b/infrastructures/postgresql/env/k3s-cluster/volume.yaml similarity index 100% rename from infrastructures/postgresql/env/k3s-cluster/templates/volume.yaml rename to infrastructures/postgresql/env/k3s-cluster/volume.yaml