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