Add Home Assistant chart

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-18 14:01:34 +02:00
co-authored by Claude Opus 5.5
commit 9f8ce47986
9 changed files with 282 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
apiVersion: v2
name: homeassistant
description: Home Assistant (container install) on the home cluster
type: application
version: 0.1.0
appVersion: "2026.10.2"
home: https://git.smokyzone.de/SmokyZone/homeassistant-gitops
sources:
- https://git.smokyzone.de/SmokyZone/homeassistant-gitops
keywords:
- home-assistant
- smart-home
maintainers:
- name: SmokyZone
+47
View File
@@ -0,0 +1,47 @@
# homeassistant-gitops
Helm chart for [Home Assistant](https://www.home-assistant.io/) (container install) on the
single-node cluster (`loki`), deployed by ArgoCD via the `apps-in-apps` repo into the
namespace `homeassistant`.
URL: https://homeassistant.smokyzone.de:30444 (LAN / Tailscale only; the DNS record
points at the node's private IP `192.168.2.218`). Certificate from
`letsencrypt-dns-cloudflare` (DNS-01).
## Design
- **hostNetwork**: HA runs in the node's network namespace so LAN discovery (mDNS/SSDP:
Chromecast, Hue, Sonos, HomeKit, ...) works. Side effect: plain HTTP is also served on
`http://192.168.2.218:8123` in the LAN. Set `hostNetwork: false` if you don't need
discovery.
- **Config** lives on the `local-path` PVC `homeassistant-config` (`/config`), which is kept
when the app is deleted. Back it up (users, integrations, history are in there).
- **configuration.yaml** is seeded once by an init container (see `seedConfiguration` in
`values.yaml`), including the reverse-proxy block:
```yaml
http:
use_x_forwarded_for: true
trusted_proxies: [10.1.0.0/16, 127.0.0.1]
```
Without it HA answers `400 Bad Request` through the ingress. After the first start the
file is yours; the chart never overwrites it. Edit it with
`kubectl -n homeassistant exec -it deploy/homeassistant -- vi /config/configuration.yaml`
and restart the pod (or *Developer tools → YAML → Restart* in the UI).
- **USB radios** (Zigbee/Z-Wave): list the device under `devices:` (prefer
`/dev/serial/by-id/...`) and set `privileged: true`.
- This is the container install: there is no add-on store (Supervisor). Add-ons such as
Mosquitto or Zigbee2MQTT would run as their own deployments in the cluster.
## First start
1. Open https://homeassistant.smokyzone.de:30444 and create the owner account during
onboarding (first visitor becomes the owner, so do this right away).
2. Home location / units / language (Deutsch) in the onboarding wizard.
3. Companion app: server URL `https://homeassistant.smokyzone.de:30444` (works at home and
via Tailscale).
## Upgrades
Bump `image.tag` in `values.yaml` (see the release notes for breaking changes first).
+10
View File
@@ -0,0 +1,10 @@
{{- define "ha.labels" -}}
app.kubernetes.io/name: homeassistant
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "ha.selectorLabels" -}}
app.kubernetes.io/name: homeassistant
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
+9
View File
@@ -0,0 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: homeassistant-seed
labels:
{{- include "ha.labels" . | nindent 4 }}
data:
configuration.yaml: |
{{- .Values.seedConfiguration | nindent 4 }}
+82
View File
@@ -0,0 +1,82 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: homeassistant
labels:
{{- include "ha.labels" . | nindent 4 }}
spec:
replicas: 1
# RWO volume + hostNetwork port: the old pod must be gone before the new one starts.
strategy:
type: Recreate
selector:
matchLabels:
{{- include "ha.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "ha.selectorLabels" . | nindent 8 }}
spec:
hostNetwork: {{ .Values.hostNetwork }}
# Keep cluster DNS (service names) working with hostNetwork.
dnsPolicy: {{ ternary "ClusterFirstWithHostNet" "ClusterFirst" .Values.hostNetwork }}
initContainers:
# Seed configuration.yaml (incl. reverse-proxy settings) on first start only.
- name: seed-config
image: busybox:1.36
command:
- sh
- -c
- |
set -e
if [ ! -f /config/configuration.yaml ]; then
cp /seed/configuration.yaml /config/configuration.yaml
echo "seeded configuration.yaml"
fi
# Files included by the seeded configuration.yaml (same defaults as HA's onboarding).
[ -f /config/automations.yaml ] || echo "[]" > /config/automations.yaml
touch /config/scripts.yaml /config/scenes.yaml
mkdir -p /config/themes
volumeMounts:
- {name: config, mountPath: /config}
- {name: seed, mountPath: /seed}
containers:
- name: homeassistant
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
env:
- name: TZ
value: {{ .Values.tz | quote }}
ports:
- name: http
containerPort: {{ .Values.port }}
{{- if .Values.privileged }}
securityContext:
privileged: true
{{- end }}
startupProbe:
tcpSocket: {port: http}
periodSeconds: 10
failureThreshold: 60
livenessProbe:
tcpSocket: {port: http}
periodSeconds: 30
failureThreshold: 5
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- {name: config, mountPath: /config}
{{- range $i, $d := .Values.devices }}
- {name: dev-{{ $i }}, mountPath: {{ $d }}}
{{- end }}
volumes:
- name: config
persistentVolumeClaim:
claimName: homeassistant-config
- name: seed
configMap:
name: homeassistant-seed
{{- range $i, $d := .Values.devices }}
- name: dev-{{ $i }}
hostPath:
path: {{ $d }}
{{- end }}
+29
View File
@@ -0,0 +1,29 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: homeassistant
labels:
{{- include "ha.labels" . | nindent 4 }}
annotations:
cert-manager.io/cluster-issuer: {{ .Values.ingress.clusterIssuer }}
{{- with .Values.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
tls:
- hosts: [{{ .Values.ingress.host }}]
secretName: homeassistant-tls
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: homeassistant
port:
name: http
{{- end }}
+18
View File
@@ -0,0 +1,18 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: homeassistant-config
labels:
{{- include "ha.labels" . | nindent 4 }}
annotations:
# Never delete the config (users, integrations, history) on uninstall/prune.
helm.sh/resource-policy: keep
argocd.argoproj.io/sync-options: Delete=false
spec:
accessModes: [ReadWriteOnce]
{{- with .Values.persistence.storageClassName }}
storageClassName: {{ . }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size }}
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: homeassistant
labels:
{{- include "ha.labels" . | nindent 4 }}
spec:
selector:
{{- include "ha.selectorLabels" . | nindent 4 }}
ports:
- name: http
port: {{ .Values.port }}
targetPort: http
+60
View File
@@ -0,0 +1,60 @@
## Values for the Home Assistant chart.
image:
repository: ghcr.io/home-assistant/home-assistant
tag: "2026.10.2"
tz: Europe/Berlin
# Run in the node's network namespace. Required for LAN discovery (mDNS/SSDP:
# Chromecast, Hue, Sonos, HomeKit, ...), which does not cross the pod network.
# Side effect: port 8123 (plain HTTP) is also open on the node's LAN IP.
hostNetwork: true
port: 8123
persistence:
# /config: configuration.yaml, .storage (users, integrations), SQLite recorder DB.
size: 5Gi
storageClassName: ""
# Written to /config/configuration.yaml on first start only (when the file does not
# exist yet). Afterwards the file belongs to you; the chart never overwrites it.
# The http block lets HA accept requests from ingress-nginx (pod network 10.1.0.0/16);
# without it HA answers 400 Bad Request to proxied requests.
seedConfiguration: |
# Loads the default set of integrations. Do not remove.
default_config:
http:
use_x_forwarded_for: true
trusted_proxies:
- 10.1.0.0/16
- 127.0.0.1
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
ingress:
enabled: true
className: nginx
# ingress-nginx is NodePort-only: https://homeassistant.smokyzone.de:30444
host: homeassistant.smokyzone.de
clusterIssuer: letsencrypt-dns-cloudflare
annotations:
# Websocket connection of the frontend / companion app stays open.
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-body-size: 100m
# USB radios (Zigbee/Z-Wave sticks), e.g. /dev/serial/by-id/usb-...; needs privileged.
devices: []
privileged: false
resources:
requests: {cpu: 100m, memory: 512Mi}
limits: {cpu: "2", memory: 2Gi}