Allow a proper pvc for the store.
All checks were successful
ci/woodpecker/push/esphome Pipeline was successful

This commit is contained in:
Alex Manning 2023-06-07 21:25:30 +01:00
parent 2457d0e81f
commit 743a9991dd
3 changed files with 34 additions and 11 deletions

View file

@ -52,7 +52,7 @@ spec:
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /config mountPath: /config
- name: temp-store - name: store
mountPath: /media/store mountPath: /media/store
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
@ -69,10 +69,15 @@ spec:
volumes: volumes:
- name: config - name: config
persistentVolumeClaim: persistentVolumeClaim:
{{- if not .Values.pvc.existingClaim }} {{- if not .Values.pvc.config.existingClaim }}
claimName: {{ include "esphome.fullname" . }}-config claimName: {{ include "esphome.fullname" . }}-config
{{- else }} {{- 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 }} {{- end }}
- name: temp-store
emptyDir: {}

View file

@ -1,4 +1,4 @@
{{- if not .Values.pvc.existingClaim -}} {{- if not .Values.pvc.config.existingClaim -}}
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
@ -10,8 +10,22 @@ metadata:
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
storageClassName: {{ .Values.pvc.storageClassName | quote }} storageClassName: {{ .Values.pvc.config.storageClassName | quote }}
resources: resources:
requests: requests:
storage: {{ .Values.pvc.storage | quote }} storage: {{ .Values.pvc.config.storage | quote }}
{{- end }} {{- 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 }}

View file

@ -48,6 +48,10 @@ tolerations: []
affinity: {} affinity: {}
pvc: pvc:
existingClaim: false config:
storageClassName: "" existingClaim: false
storage: 5Gi storageClassName: ""
storage: 1Gi
store:
storageClassName: ""
storage: 5Gi