home-assistant: Deploy Home Assistant

This commit adds resources for deploying the Home Assistant ecosystem
inside Kubernetes.  Home Assistant itself, as well as Mosquitto, are
just normal Pods, managed by StatefulSets, that can run anywhere.
ZWaveJS2MQTT and Zigbee2MQTT, on the other hand, have to run on a
special node (a Raspberry Pi), where the respective controllers are
attached.

The Home Assistant UI is exposed externally via an Ingress resource.
The MQTT broker is also exposed externally, using the TCP proxy feature
of *ingress-nginx*.  Additionally, the Zigbee2MQTT and ZWaveJS2MQTT
control panels are exposed via Ingress resources, but these are
protected by Authelia.
This commit is contained in:
2023-07-24 17:48:38 -05:00
parent 2153097930
commit a7eac14d39
17 changed files with 1870 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
app.kubernetes.io/part-of: home-assistant
name: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 60Gi
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
app.kubernetes.io/part-of: home-assistant
name: home-assistant
spec:
ports:
- port: 8123
name: http
selector:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
app.kubernetes.io/part-of: home-assistant
name: home-assistant
spec:
serviceName: home-assistant
selector:
matchLabels:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
template:
metadata:
labels:
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/name: home-assistant
app.kubernetes.io/part-of: home-assistant
spec:
containers:
- name: home-assistant
image: ghcr.io/home-assistant/home-assistant:stable
env:
- name: TZ
value: America/Chicago
ports:
- containerPort: 8123
name: http
readinessProbe: &probe
httpGet:
port: 8123
path: /
failureThreshold: 3
periodSeconds: 60
successThreshold: 1
timeoutSeconds: 1
startupProbe:
<<: *probe
failureThreshold: 30
periodSeconds: 3
initialDelaySeconds: 3
securityContext:
runAsUser: 300
runAsGroup: 300
volumeMounts:
- name: home-assistant-data
mountPath: /config
subPath: data
securityContext:
fsGroup: 300
volumes:
- name: home-assistant-data
persistentVolumeClaim:
claimName: home-assistant