From 743a9991ddcb2ff131506d72608cf573f92482c8 Mon Sep 17 00:00:00 2001 From: Alex Manning Date: Wed, 7 Jun 2023 21:25:30 +0100 Subject: [PATCH] Allow a proper pvc for the store. --- charts/esphome/templates/deployment.yaml | 15 ++++++++++----- charts/esphome/templates/pvc.yaml | 20 +++++++++++++++++--- charts/esphome/values.yaml | 10 +++++++--- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/charts/esphome/templates/deployment.yaml b/charts/esphome/templates/deployment.yaml index b783164..307795c 100644 --- a/charts/esphome/templates/deployment.yaml +++ b/charts/esphome/templates/deployment.yaml @@ -52,7 +52,7 @@ spec: volumeMounts: - name: config mountPath: /config - - name: temp-store + - name: store mountPath: /media/store {{- with .Values.nodeSelector }} nodeSelector: @@ -69,10 +69,15 @@ spec: volumes: - name: config persistentVolumeClaim: - {{- if not .Values.pvc.existingClaim }} + {{- if not .Values.pvc.config.existingClaim }} claimName: {{ include "esphome.fullname" . }}-config {{- else }} - claimName: {{ .Values.pvc.existingClaim }} + claimName: {{ .Values.pvc.config.existingClaim }} + {{- end }} + - name: store + persistentVolumeClaim: + {{- if not .Values.pvc.store.existingClaim }} + claimName: {{ include "esphome.fullname" . }}-store + {{- else }} + claimName: {{ .Values.pvc.config.existingClaim }} {{- end }} - - name: temp-store - emptyDir: {} diff --git a/charts/esphome/templates/pvc.yaml b/charts/esphome/templates/pvc.yaml index f81e4e0..0a0d10b 100644 --- a/charts/esphome/templates/pvc.yaml +++ b/charts/esphome/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.pvc.existingClaim -}} +{{- if not .Values.pvc.config.existingClaim -}} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -10,8 +10,22 @@ metadata: spec: accessModes: - ReadWriteOnce - storageClassName: {{ .Values.pvc.storageClassName | quote }} + storageClassName: {{ .Values.pvc.config.storageClassName | quote }} resources: requests: - storage: {{ .Values.pvc.storage | quote }} + storage: {{ .Values.pvc.config.storage | quote }} {{- end }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "esphome.fullname" . }}-store + labels: + {{- include "esphome.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + storageClassName: {{ .Values.pvc.store.storageClassName | quote }} + resources: + requests: + storage: {{ .Values.pvc.store.storage | quote }} diff --git a/charts/esphome/values.yaml b/charts/esphome/values.yaml index 9cc68c5..ba2d02e 100644 --- a/charts/esphome/values.yaml +++ b/charts/esphome/values.yaml @@ -48,6 +48,10 @@ tolerations: [] affinity: {} pvc: - existingClaim: false - storageClassName: "" - storage: 5Gi + config: + existingClaim: false + storageClassName: "" + storage: 1Gi + store: + storageClassName: "" + storage: 5Gi