From c9566fd42eccd339a143c049b05a511d7d360d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roch=C3=A9=20Compaan?= Date: Mon, 8 Jul 2024 15:53:05 +0200 Subject: [PATCH] feat: use dynamic volume provisioning for postgres pvc (#270) Use dynamic volume provisioning for the Postres PVC. We shouldn't hardcode the storage class or the mount path. We should defer this to the cluster configuration. https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/#using-dynamic-provisioning --- .../k8s/local/postgres.yaml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/{{cookiecutter.project_slug}}/k8s/local/postgres.yaml b/{{cookiecutter.project_slug}}/k8s/local/postgres.yaml index ef333b60..18f087f5 100644 --- a/{{cookiecutter.project_slug}}/k8s/local/postgres.yaml +++ b/{{cookiecutter.project_slug}}/k8s/local/postgres.yaml @@ -63,31 +63,14 @@ spec: claimName: postgres-pvc --- apiVersion: v1 -kind: PersistentVolume -metadata: - name: postgres-pv - labels: - type: local -spec: - storageClassName: manual - capacity: - storage: 1Gi - accessModes: - - ReadWriteOnce - hostPath: - path: /mnt/postgres-data ---- -apiVersion: v1 kind: PersistentVolumeClaim metadata: name: postgres-pvc labels: type: local spec: - storageClassName: manual accessModes: - ReadWriteOnce resources: requests: storage: 500Mi - volumeName: postgres-pv