[zigbee2mqtt] Migrate to common v3 (#956)

* added privileged flag to readme for clarity (#955)

* [zigbee2mqtt] Upgrade to common v3

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

* Small README fix

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

Co-authored-by: itobey <itobey@users.noreply.github.com>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2021-06-09 20:02:15 +02:00 committed by GitHub
parent 89e09bde2a
commit 6b9dbce1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 103 additions and 100 deletions

View File

@ -1,8 +1,8 @@
apiVersion: v2 apiVersion: v2
appVersion: 1.17.1 appVersion: 1.19.1
description: Bridges events and allows you to control your Zigbee devices via MQTT description: Bridges events and allows you to control your Zigbee devices via MQTT
name: zigbee2mqtt name: zigbee2mqtt
version: 7.4.0 version: 8.0.0
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
keywords: keywords:
- zigbee - zigbee
@ -13,11 +13,11 @@ icon: https://www.zigbee2mqtt.io/images/logo.png
sources: sources:
- https://github.com/Koenkk/zigbee2mqtt - https://github.com/Koenkk/zigbee2mqtt
maintainers: maintainers:
- name: ishioni
email: helm@movishell.pl
- name: masantiago - name: masantiago
email: miguelangel.santiago@hotmail.com email: miguelangel.santiago@hotmail.com
- name: bjw-s
email: me@bjw-s.dev
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.k8s-at-home.com repository: https://library-charts.k8s-at-home.com
version: 2.5.0 version: 3.0.1

View File

@ -1,6 +1,6 @@
# zigbee2mqtt # zigbee2mqtt
![Version: 7.4.0](https://img.shields.io/badge/Version-7.4.0-informational?style=flat-square) ![AppVersion: 1.17.1](https://img.shields.io/badge/AppVersion-1.17.1-informational?style=flat-square) ![Version: 8.0.0](https://img.shields.io/badge/Version-8.0.0-informational?style=flat-square) ![AppVersion: 1.19.1](https://img.shields.io/badge/AppVersion-1.19.1-informational?style=flat-square)
Bridges events and allows you to control your Zigbee devices via MQTT Bridges events and allows you to control your Zigbee devices via MQTT
@ -18,7 +18,7 @@ Kubernetes: `>=1.16.0-0`
| Repository | Name | Version | | Repository | Name | Version |
|------------|------|---------| |------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 2.5.0 | | https://library-charts.k8s-at-home.com | common | 3.0.1 |
## TL;DR ## TL;DR
@ -98,38 +98,31 @@ affinity:
... where a node with an attached zigbee controller USB device is labeled with `app: zigbee-controller` ... where a node with an attached zigbee controller USB device is labeled with `app: zigbee-controller`
If you are getting errors, that the device cannot be opened when starting Zigbee2Mqtt, try uncommenting the privileged flag:
```
securityContext:
privileged: true
```
## Values ## Values
**Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common) **Important**: When deploying an application Helm chart you can add more values from our common library chart [here](https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common)
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| additionalVolumeMounts | list | `[]` | | | affinity | object | `{}` | Affinity constraint rules to place the Pod on a specific node. [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) |
| additionalVolumes | list | `[]` | | | config | object | See values.yaml | zigbee2mqtt configuration settings. This will be copied into the container's persistent storage at first run only. Further configuration should be done in the application itself! See [project documentation](https://www.zigbee2mqtt.io/information/configuration.html) for more information. |
| config.advanced.homeassistant_discovery_topic | string | `"homeassistant"` | | | env | object | See below | environment variables. See [image docs](https://www.zigbee2mqtt.io/information/configuration.html#override-via-environment-variables) for more details. |
| config.advanced.homeassistant_status_topic | string | `"homeassistant/status"` | | | env.ZIGBEE2MQTT_DATA | string | `"/data"` | Set the data folder for Zigbee2MQTT. |
| config.advanced.last_seen | string | `"ISO_8601"` | | | image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| config.advanced.log_level | string | `"info"` | | | image.repository | string | `"koenkk/zigbee2mqtt"` | image repository |
| config.advanced.log_output[0] | string | `"console"` | | | image.tag | string | `"1.19.1"` | image tag |
| config.advanced.network_key | string | `"GENERATE"` | | | ingress.main | object | See values.yaml | Enable and configure ingress settings for the chart under this key. |
| config.experimental.new_api | bool | `true` | | | persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
| config.frontend.port | int | `8080` | | | persistence.usb | object | See values.yaml | Configure a hostPathMount to mount a USB device in the container. |
| config.homeassistant | bool | `false` | | | securityContext.privileged | bool | `nil` | Privileged securityContext may be required if USB controller is accessed directly through the host machine |
| config.mqtt.base_topic | string | `"zigbee2mqtt"` | | | service | object | See values.yaml | Configures service settings for the chart. Normally this does not need to be modified. |
| config.mqtt.include_device_information | bool | `true` | |
| config.mqtt.server | string | `"mqtt://localhost"` | |
| config.permit_join | bool | `true` | |
| config.serial | string | `nil` | |
| env.ZIGBEE2MQTT_DATA | string | `"/data"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"koenkk/zigbee2mqtt"` | |
| image.tag | string | `"1.17.1"` | |
| ingress.enabled | bool | `false` | |
| persistence.data.emptyDir.enabled | bool | `false` | |
| persistence.data.enabled | bool | `false` | |
| persistence.data.mountPath | string | `"/data"` | |
| service.port.port | int | `8080` | |
| strategy.type | string | `"Recreate"` | |
## Changelog ## Changelog
@ -137,6 +130,14 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [8.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.0.1. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.0.1/charts/stable/common/) for the up-to-date values.
- Changed image tag to `1.19.1`.
### [1.0.0] ### [1.0.0]
#### Added #### Added
@ -151,7 +152,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A - N/A
[1.0.0]: #1.0.0 [8.0.0]: #800
[1.0.0]: #100
## Support ## Support

View File

@ -9,6 +9,14 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [8.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.0.1. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.0.1/charts/stable/common/) for the up-to-date values.
- Changed image tag to `1.19.1`.
### [1.0.0] ### [1.0.0]
#### Added #### Added
@ -23,5 +31,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A - N/A
[1.0.0]: #1.0.0 [8.0.0]: #800
[1.0.0]: #100
{{- end -}} {{- end -}}

View File

@ -35,4 +35,11 @@ affinity:
``` ```
... where a node with an attached zigbee controller USB device is labeled with `app: zigbee-controller` ... where a node with an attached zigbee controller USB device is labeled with `app: zigbee-controller`
If you are getting errors, that the device cannot be opened when starting Zigbee2Mqtt, try uncommenting the privileged flag:
```
securityContext:
privileged: true
```
{{- end -}} {{- end -}}

View File

@ -1,8 +1,9 @@
ingress: ingress:
enabled: true main:
enabled: true
persistence: persistence:
data: data:
enabled: true enabled: true
emptyDir: type: emptyDir
enabled: true
mountPath: /data mountPath: /data

View File

@ -1,31 +1,17 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }} {{- include "common.values.setup" . }}
{{/* Append the configMap to the additionalVolumes */}} {{/* Append the configMap volume to the volumes */}}
{{- define "zigbee2mqtt.configmap.volume" -}} {{- define "zigbee2mqtt.settingsVolume" -}}
name: zigbee2mqtt-settings enabled: "true"
configMap: mountPath: "/app/configuration.yaml"
name: {{ template "common.names.fullname" . }}-settings subPath: "configuration.yaml"
{{- end -}} type: "custom"
volumeSpec:
{{- $volume := include "zigbee2mqtt.configmap.volume" . | fromYaml -}} configMap:
{{- if $volume -}} name: {{ include "common.names.fullname" . }}-settings
{{- $additionalVolumes := append .Values.additionalVolumes $volume }}
{{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}}
{{- end -}}
{{/* Append the configMap volume to the additionalVolumeMounts */}}
{{- define "zigbee2mqtt.configmap.volumeMount" -}}
name: zigbee2mqtt-settings
mountPath: /app/configuration.yaml
subPath: configuration.yaml
{{- end -}}
{{- $volumeMount := include "zigbee2mqtt.configmap.volumeMount" . | fromYaml -}}
{{- if $volumeMount -}}
{{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount }}
{{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}}
{{- end -}} {{- end -}}
{{- $_ := set .Values.persistence "zigbee2mqtt-settings" (include "zigbee2mqtt.settingsVolume" . | fromYaml) -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "common.all" . }} {{ include "common.all" . }}

View File

@ -6,58 +6,53 @@
# #
image: image:
# -- image repository
repository: koenkk/zigbee2mqtt repository: koenkk/zigbee2mqtt
# -- image tag
tag: 1.19.1
# -- image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: 1.17.1
strategy:
type: Recreate
# -- environment variables. See [image docs](https://www.zigbee2mqtt.io/information/configuration.html#override-via-environment-variables) for more details.
# @default -- See below
env: env:
# -- Set the data folder for Zigbee2MQTT.
ZIGBEE2MQTT_DATA: /data ZIGBEE2MQTT_DATA: /data
# -- Configures service settings for the chart. Normally this does not need to be modified.
# @default -- See values.yaml
service: service:
port: main:
port: 8080 ports:
http:
port: 8080
ingress: ingress:
enabled: false # -- Enable and configure ingress settings for the chart under this key.
# @default -- See values.yaml
main:
enabled: false
# Privileged may be required if USB controller is accessed directly through the host machine securityContext:
# securityContext: # -- (bool) Privileged securityContext may be required if USB controller is accessed directly through the host machine
# privileged: true privileged: # true
# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence: persistence:
data: data:
enabled: false enabled: false
emptyDir:
enabled: false
mountPath: /data mountPath: /data
## Persistent Volume Storage Class # -- Configure a hostPathMount to mount a USB device in the container.
## If defined, storageClassName: <storageClass> # @default -- See values.yaml
## If set to "-", storageClassName: "", which disables dynamic provisioning usb:
## If undefined (the default) or set to null, no storageClassName spec is enabled: false
## set, choosing the default provisioner. (gp2 on AWS, standard on type: hostPath
## GKE, AWS & OpenStack) hostPath: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00
# storageClass: "-"
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
# skipuninstall: false
# existingClaim: ""
# Path to your zigbee device in the container # -- Affinity constraint rules to place the Pod on a specific node.
additionalVolumeMounts: [] # [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
# - name: usb affinity: {}
# mountPath: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00
# Path to your zigbee device on the host
additionalVolumes: []
# - name: usb
# hostPath:
# path: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00
# affinity:
# nodeAffinity: # nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution: # requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms: # nodeSelectorTerms:
@ -67,8 +62,11 @@ additionalVolumes: []
# values: # values:
# - zigbee-controller # - zigbee-controller
# zigbee2mqtt configuration settings # -- zigbee2mqtt configuration settings.
# https://www.zigbee2mqtt.io/information/configuration.html # This will be copied into the container's persistent storage at first run only.
# Further configuration should be done in the application itself!
# See [project documentation](https://www.zigbee2mqtt.io/information/configuration.html) for more information.
# @default -- See values.yaml
config: config:
# These will be applied ONLY on first run # These will be applied ONLY on first run
# Home Assistant integration (MQTT discovery) # Home Assistant integration (MQTT discovery)