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
+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 }}