From d0566e7176a4830503de228f971b860e91b426f3 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 10 Apr 2023 20:40:18 -0400 Subject: [PATCH] Create pvc for postgresql --- cluster/apps/database/postgresql/helm-release.yaml | 4 ++++ cluster/apps/database/postgresql/kustomization.yaml | 2 ++ cluster/apps/database/postgresql/pgsql-pv.yaml | 13 +++++++++++++ cluster/apps/database/postgresql/pgsql-pvc.yaml | 12 ++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 cluster/apps/database/postgresql/pgsql-pv.yaml create mode 100644 cluster/apps/database/postgresql/pgsql-pvc.yaml diff --git a/cluster/apps/database/postgresql/helm-release.yaml b/cluster/apps/database/postgresql/helm-release.yaml index 98bdf80..5822c54 100644 --- a/cluster/apps/database/postgresql/helm-release.yaml +++ b/cluster/apps/database/postgresql/helm-release.yaml @@ -21,3 +21,7 @@ spec: adminPasswordKey: "adminPassword" userPasswordKey: "userPassword" replicationPasswordKey: "replicationPassword" + + primary: + persistence: + existingClaim: "postgresql-pv-claim" diff --git a/cluster/apps/database/postgresql/kustomization.yaml b/cluster/apps/database/postgresql/kustomization.yaml index a42facf..721e315 100644 --- a/cluster/apps/database/postgresql/kustomization.yaml +++ b/cluster/apps/database/postgresql/kustomization.yaml @@ -1,6 +1,8 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: +- ./pgsql-pv.yaml +- ./pgsql-pvc.yaml - ./pgsql.sops.yaml - ./helm-release.yaml - ./pgadmin4 \ No newline at end of file diff --git a/cluster/apps/database/postgresql/pgsql-pv.yaml b/cluster/apps/database/postgresql/pgsql-pv.yaml new file mode 100644 index 0000000..3e6fecd --- /dev/null +++ b/cluster/apps/database/postgresql/pgsql-pv.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: postgresql-pv + namespace: database +spec: + storageClassName: manual + capacity: + storage: 10Gi + accessModes: + - ReadWriteOnce + hostPath: + path: "/mnt/MainPool/Kubernetes/databases/postgresql" \ No newline at end of file diff --git a/cluster/apps/database/postgresql/pgsql-pvc.yaml b/cluster/apps/database/postgresql/pgsql-pvc.yaml new file mode 100644 index 0000000..bcacad3 --- /dev/null +++ b/cluster/apps/database/postgresql/pgsql-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: postgresql-pv-claim + namespace: database +spec: + storageClassName: manual + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi \ No newline at end of file