4444 image : " {{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4545 imagePullPolicy : {{ .Values.image.pullPolicy }}
4646 env :
47- {{/* Common labels
4847 - name : TZ
4948 value : {{ .Values.timezone }}
50- */}}
5149 - name : ZIGBEE2MQTT_DATA
5250 value : " /data"
5351 {{- if .Values.debug }}
@@ -104,46 +102,62 @@ spec:
104102 initialDelaySeconds : {{ .Values.readinessProbe.initialDelaySeconds}}
105103 {{- end }}
106104 volumeMounts :
107- - name : config-storage
105+ - name : zigbee2mqtt
106+ mountPath : /app/configuration.yaml
107+ subPath : configuration.yaml
108+ - name : data
108109 mountPath : /data
109- {{- range .Values.hostMounts }}
110- {{- if .mountPath }}
111- - mountPath : {{ .mountPath }}
112- {{- else }}
113- - mountPath : {{ .hostPath }}
114- {{- end }}
115- name : {{ .name }}
116- {{- end }}
110+ - name : sniffer
111+ mountPath : {{ .Values.config.serial.port }}
112+ volumes :
113+ - name : zigbee2mqtt
114+ configMap :
115+ name : {{ include "app.fullname" . }}
116+ - name : sniffer
117+ hostPath :
118+ path : {{ required "You must specify a path to your zigbee sniffer" .Values.config.serial.port }}
119+ {{- if not .Values.persistence.enabled }}
120+ - name : data
121+ emptyDir : {}
122+ {{- end }}
123+ {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
124+ - name : data
125+ persistentVolumeClaim :
126+ claimName : {{ .Values.persistence.existingClaim }}
127+ {{- end }}
117128 {{- with .Values.nodeSelector }}
118129 nodeSelector :
119- {{- toYaml . | nindent 8 }}
130+ {{- toYaml . | nindent 8 }}
120131 {{- end }}
121132 {{- with .Values.affinity }}
122133 affinity :
123- {{- toYaml . | nindent 8 }}
134+ {{- toYaml . | nindent 8 }}
124135 {{- end }}
125136 {{- with .Values.tolerations }}
126137 tolerations :
127- {{- toYaml . | nindent 8 }}
128- {{- end }}
129- volumes :
130- - name : config-storage
131- {{- if .Values.persistence.enabled }}
132- {{- if .Values.persistence.hostPath }}
133- hostPath :
134- path : {{.Values.persistence.hostPath}}
135- {{- else }}
136- persistentVolumeClaim :
137- claimName : {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "app.fullname" . }}{{- end }}
138- {{- end }}
139- {{- else }}
140- emptyDir : {}
141- {{ end }}
142- {{- range .Values.hostMounts }}
143- - name : {{ .name }}
144- hostPath :
145- path : {{.hostPath}}
146- {{- if .type }}
147- type : {{ .type }}
138+ {{- toYaml . | nindent 8 }}
148139 {{- end }}
149- {{- end }}
140+ volumeClaimTemplates :
141+ {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
142+ - metadata :
143+ name : data
144+ labels :
145+ app.kubernetes.io/name : {{ include "app.name" . }}
146+ app.kubernetes.io/instance : {{ .Release.Name }}
147+ {{- if .Values.persistence.annotations }}
148+ annotations :
149+ {{ toYaml .Values.persistence.annotations | indent 4 }}
150+ {{- end }}
151+ spec :
152+ accessModes : [ {{ .Values.persistence.accessMode | quote }} ]
153+ resources :
154+ requests :
155+ storage : {{ .Values.persistence.size | quote }}
156+ {{- if .Values.persistence.storageClass }}
157+ {{- if (eq "-" .Values.persistence.storageClass) }}
158+ storageClassName : " "
159+ {{- else }}
160+ storageClassName : {{ .Values.persistence.storageClass | quote }}
161+ {{- end }}
162+ {{- end }}
163+ {{- end }}
0 commit comments