From 07b9a68b3f370b3a1b13ebac19381be3c43e0427 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Thu, 18 Jul 2024 23:58:56 +1000 Subject: [PATCH] add infra app postgresql --- .../postgresql/env/k3s-cluster/config.json | 12 +++++ .../env/k3s-cluster/kustomization.yaml | 8 ++++ .../postgresql/env/k3s-cluster/values.yaml | 46 +++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 infrastructures/postgresql/env/k3s-cluster/config.json create mode 100644 infrastructures/postgresql/env/k3s-cluster/kustomization.yaml create mode 100644 infrastructures/postgresql/env/k3s-cluster/values.yaml diff --git a/infrastructures/postgresql/env/k3s-cluster/config.json b/infrastructures/postgresql/env/k3s-cluster/config.json new file mode 100644 index 0000000..a304fb3 --- /dev/null +++ b/infrastructures/postgresql/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "postgresql", + "userGivenName": "postgresql", + "namespace": "postgresql", + "destNamespace": "postgresql", + "destServer": "https://kubernetes.default.svc", + "srcPath": "infrastructures/postgresql/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml b/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..f7d5c56 --- /dev/null +++ b/infrastructures/postgresql/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +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 new file mode 100644 index 0000000..5f2148d --- /dev/null +++ b/infrastructures/postgresql/env/k3s-cluster/values.yaml @@ -0,0 +1,46 @@ +auth: + username: edward + database: edwarddb + existingSecret: "postgresql-secrets" + secretKeys: + adminPasswordKey: postgres_password + userPasswordKey: password + replicationPasswordKey: replication_password +architecture: "replication" +replication: + synchronousCommit: "on" + numSynchronousReplicas: 1 + applicationName: "postgres_repl" +primary: + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 + podLabels: + name: "postgresql-primary" + service: + type: "LoadBalancer" + persistence: + existingClaim: postgresql-primary-pvc + selector: + matchLabels: + name: postgresql-primary-pvc +readReplicas: + name: "replica" + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 + podLabels: + name: "postgresql-replica" + service: + type: "LoadBalancer" + ports: + postgresql: 5433 + persistence: + existingClaim: postgresql-replica-pvc + selector: + matchLabels: + name: postgresql-replica-pvc \ No newline at end of file