From 51d5262fbf54c683aeee16ba0a0134e01ecc47e7 Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Thu, 5 Sep 2024 12:36:48 +0300 Subject: [PATCH 1/2] Tie the db pv to a google filestore for persistence and concurrent access --- helm-chart/templates/deployment.yaml | 2 +- helm-chart/templates/pvc.yaml | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/helm-chart/templates/deployment.yaml b/helm-chart/templates/deployment.yaml index 57c453d..366e7b9 100644 --- a/helm-chart/templates/deployment.yaml +++ b/helm-chart/templates/deployment.yaml @@ -63,7 +63,7 @@ spec: volumes: - name: db persistentVolumeClaim: - claimName: db-pvc + claimName: {{ .Release.Name }}-db-pvc {{- if .Values.yamlSettings.enabled }} - name: django-yamlconf configMap: diff --git a/helm-chart/templates/pvc.yaml b/helm-chart/templates/pvc.yaml index b83471b..c302623 100644 --- a/helm-chart/templates/pvc.yaml +++ b/helm-chart/templates/pvc.yaml @@ -1,11 +1,25 @@ apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-db-nfs +spec: + capacity: + storage: 1Ti + accessModes: + - ReadWriteMany + nfs: + server: {{ .Values.nfs.pv.serverIP | quote }} + path: "/db/{{ .Release.Name }}" + mountOptions: {{ .Values.nfs.pv.mountOptions | toJson }} +--- +apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: db-pvc + name: {{ .Release.Name }}-db-pvc spec: accessModes: - - ReadWriteOnce + - ReadWriteMany + volumeName: {{ .Release.Name }}-db-nfs resources: requests: - # To be updated with the actual storage size - storage: 1Gi + storage: 1Ti From f49d8634b4cdcf0c19d8fa69a2bb15c58d6e299e Mon Sep 17 00:00:00 2001 From: Georgiana Dolocan Date: Thu, 5 Sep 2024 12:37:43 +0300 Subject: [PATCH 2/2] Rename the file as it now has both pv and pvc definitions --- helm-chart/templates/{pvc.yaml => nfs.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename helm-chart/templates/{pvc.yaml => nfs.yaml} (100%) diff --git a/helm-chart/templates/pvc.yaml b/helm-chart/templates/nfs.yaml similarity index 100% rename from helm-chart/templates/pvc.yaml rename to helm-chart/templates/nfs.yaml