From a8451c8c0c856c0ac619b290250c52b28fb021f2 Mon Sep 17 00:00:00 2001 From: JacekZubielik Date: Tue, 20 Aug 2024 18:00:59 +0200 Subject: [PATCH] build(zigbee2mqtt): 0.0.8 --- charts/zigbee2mqtt/Chart.yaml | 2 +- .../zigbee2mqtt/templates/statefullset.yaml | 84 +++++++++++-------- charts/zigbee2mqtt/values.yaml | 40 ++++++--- 3 files changed, 80 insertions(+), 46 deletions(-) diff --git a/charts/zigbee2mqtt/Chart.yaml b/charts/zigbee2mqtt/Chart.yaml index 5a8e6c3..8285ff2 100644 --- a/charts/zigbee2mqtt/Chart.yaml +++ b/charts/zigbee2mqtt/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 1.39.1 description: Zigbee Bridge via MQTT name: zigbee2mqtt -version: 0.0.7 +version: 0.0.8 type: application keywords: - zigbee2mqtt diff --git a/charts/zigbee2mqtt/templates/statefullset.yaml b/charts/zigbee2mqtt/templates/statefullset.yaml index e17e03a..bac91c7 100644 --- a/charts/zigbee2mqtt/templates/statefullset.yaml +++ b/charts/zigbee2mqtt/templates/statefullset.yaml @@ -44,10 +44,8 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: -{{/* Common labels - name: TZ value: {{ .Values.timezone }} -*/}} - name: ZIGBEE2MQTT_DATA value: "/data" {{- if .Values.debug }} @@ -104,46 +102,62 @@ spec: initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds}} {{- end }} volumeMounts: - - name: config-storage + - name: zigbee2mqtt + mountPath: /app/configuration.yaml + subPath: configuration.yaml + - name: data mountPath: /data - {{- range .Values.hostMounts }} - {{- if .mountPath }} - - mountPath: {{ .mountPath }} - {{- else }} - - mountPath: {{ .hostPath }} - {{- end }} - name: {{ .name }} - {{- end }} + - name: sniffer + mountPath: {{ .Values.config.serial.port }} + volumes: + - name: zigbee2mqtt + configMap: + name: {{ include "app.fullname" . }} + - name: sniffer + hostPath: + path: {{ required "You must specify a path to your zigbee sniffer" .Values.config.serial.port }} + {{- if not .Values.persistence.enabled }} + - name: data + emptyDir: {} + {{- end }} + {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }} + - name: data + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - - name: config-storage - {{- if .Values.persistence.enabled }} - {{- if .Values.persistence.hostPath }} - hostPath: - path: {{.Values.persistence.hostPath}} - {{- else }} - persistentVolumeClaim: - claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "app.fullname" . }}{{- end }} - {{- end }} - {{- else }} - emptyDir: {} - {{ end }} - {{- range .Values.hostMounts }} - - name: {{ .name }} - hostPath: - path: {{.hostPath}} - {{- if .type }} - type: {{ .type }} + {{- toYaml . | nindent 8 }} {{- end }} - {{- end }} \ No newline at end of file + volumeClaimTemplates: + {{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} + - metadata: + name: data + labels: + app.kubernetes.io/name: {{ include "app.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + {{- if .Values.persistence.annotations }} + annotations: + {{ toYaml .Values.persistence.annotations | indent 4 }} + {{- end }} + spec: + accessModes: [ {{ .Values.persistence.accessMode | quote }} ] + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.persistence.storageClass | quote }} + {{- end }} + {{- end }} + {{- end }} diff --git a/charts/zigbee2mqtt/values.yaml b/charts/zigbee2mqtt/values.yaml index 1a0d4cc..63e378e 100644 --- a/charts/zigbee2mqtt/values.yaml +++ b/charts/zigbee2mqtt/values.yaml @@ -9,6 +9,33 @@ fullnameOverride: "" revisionHistoryLimit: 4 hostNetwork: false +timezone: "CET" + +config: + # These will be applied ONLY on first run + # Home Assistant integration (MQTT discovery) + homeassistant: false + # allow new devices to join + permit_join: true + # MQTT settings + mqtt: + # MQTT base topic for zigbee2mqtt MQTT messages + base_topic: zigbee2mqtt + # MQTT server URL + server: 'mqtt://localhost' + # MQTT server authentication, uncomment if required: + # user: my_user + # password: my_password + # Serial settings + serial: + # Location of USB sniffer + port: /dev/ttyUSB0 + advanced: + network_key: GENERATE + log_output: + - console + + replicas: 1 updateStrategy: type: RollingUpdate @@ -149,7 +176,8 @@ tolerations: [] persistence: enabled: false - ## esphome data Persistent Volume Storage Class + annotations: {} + ## zigbee2mqtt data Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning ## If undefined (the default) or set to null, no storageClassName spec is @@ -160,14 +188,6 @@ persistence: ## ## If you want to reuse an existing claim, you can pass the name of the PVC using ## the existingClaim variable - # existingClaim: your-claim - ## - ## If you want to use a volume on the host machine instead of a PVC: - # hostPath: /path/to/the/config/folder + # existingClaim: zigbee2mqtt-data accessMode: ReadWriteOnce size: 1Gi - -# Mount devices or folders from the host machine. Can be used for USB device mounting. -# hostMounts: -# - name: sniffer -# hostPath: /dev/ttyUSB0