diff --git a/zigbee2mqtt/Chart.yaml b/zigbee2mqtt/Chart.yaml new file mode 100644 index 0000000..4e23d3a --- /dev/null +++ b/zigbee2mqtt/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 +name: zigbee2mqtt +description: Zigbee2MQTT Helm chart +type: application +version: 0.1.0 +appVersion: "2.9.1" +annotations: + version-source: github-release:Koenkk/zigbee2mqtt diff --git a/zigbee2mqtt/templates/deployment.yaml b/zigbee2mqtt/templates/deployment.yaml new file mode 100644 index 0000000..fad1fab --- /dev/null +++ b/zigbee2mqtt/templates/deployment.yaml @@ -0,0 +1,72 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: server + app.kubernetes.io/part-of: home-automation + annotations: + version-source: {{ index .Chart.Annotations "version-source" }} +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - containerPort: {{ .Values.httpPort }} + name: http + env: + - name: TZ + value: {{ .Values.timezone | quote }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 3 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 60 + periodSeconds: 30 + timeoutSeconds: 10 + failureThreshold: 3 + volumeMounts: + - name: data + mountPath: /app/data + volumes: + - name: data + hostPath: + path: {{ .Values.volume.hostPath }} + type: DirectoryOrCreate diff --git a/zigbee2mqtt/templates/ingress.yaml b/zigbee2mqtt/templates/ingress.yaml new file mode 100644 index 0000000..9eca732 --- /dev/null +++ b/zigbee2mqtt/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }} + port: + number: {{ $.Values.service.port }} + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/zigbee2mqtt/templates/service.yaml b/zigbee2mqtt/templates/service.yaml new file mode 100644 index 0000000..ef6cea2 --- /dev/null +++ b/zigbee2mqtt/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: {{ .Values.service.type }} + selector: + app: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.service.port }} + targetPort: http + protocol: TCP diff --git a/zigbee2mqtt/values.yaml b/zigbee2mqtt/values.yaml new file mode 100644 index 0000000..70430fb --- /dev/null +++ b/zigbee2mqtt/values.yaml @@ -0,0 +1,37 @@ +# Default values for Zigbee2MQTT Helm Chart +image: + repository: ghcr.io/koenkk/zigbee2mqtt + pullPolicy: IfNotPresent + +timezone: "Europe/Kyiv" + +# Container port exposed by the Zigbee2MQTT frontend +httpPort: 8080 + +service: + type: ClusterIP + port: 80 + +resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "2" + memory: "1Gi" + +# Persistent /app/data directory (configuration, device database, coordinator backup) +volume: + hostPath: "" + +nodeSelector: {} +tolerations: [] +affinity: {} + +ingresses: {} + # https: + # host: zigbee2mqtt.example.com + # annotations: {} + # tls: + # - hosts: + # - zigbee2mqtt.example.com