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,91 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: home-assistant
labels:
app.kubernetes.io/name: home-assistant
app.kubernetes.io/component: home-assistant
app.kubernetes.io/instance: home-assistant
app.kubernetes.io/part-of: home-assistant
spec:
ingressClassName: nginx
rules:
- host: homeassistant.pyrocufflink.blue
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: home-assistant
port:
name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: zigbee2mqtt
labels:
app.kubernetes.io/name: zigbee2mqtt
app.kubernetes.io/component: zigbee2mqtt
app.kubernetes.io/instance: zigbee2mqtt
app.kubernetes.io/part-of: home-assistant
annotations:
nginx.ingress.kubernetes.io/auth-method: GET
nginx.ingress.kubernetes.io/auth-url: http://authelia.authelia.svc.cluster.local:9091/api/verify
nginx.ingress.kubernetes.io/auth-signin: https://auth.pyrocufflink.blue/?rm=$request_method
nginx.ingress.kubernetes.io/auth-response-headers: Remote-User,Remote-Name,Remote-Groups,Remote-Email
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Forwarded-Method $request_method;
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
ingressClassName: nginx
rules:
- host: homeassistant.pyrocufflink.blue
http:
paths:
- path: /zigbee/(.*)
pathType: Prefix
backend:
service:
name: zigbee2mqtt
port:
name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: zwavejs2mqtt
labels:
app.kubernetes.io/name: zwavejs2mqtt
app.kubernetes.io/component: zwavejs2mqtt
app.kubernetes.io/instance: zwavejs2mqtt
app.kubernetes.io/part-of: home-assistant
annotations:
nginx.ingress.kubernetes.io/auth-method: GET
nginx.ingress.kubernetes.io/auth-url: http://authelia.authelia.svc.cluster.local:9091/api/verify
nginx.ingress.kubernetes.io/auth-signin: https://auth.pyrocufflink.blue/?rm=$request_method
nginx.ingress.kubernetes.io/auth-response-headers: Remote-User,Remote-Name,Remote-Groups,Remote-Email
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Forwarded-Method $request_method;
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header X-External-Path /zwave;
spec:
ingressClassName: nginx
rules:
- host: homeassistant.pyrocufflink.blue
http:
paths:
- path: /zwave/(.*)
pathType: Prefix
backend:
service:
name: zwavejs2mqtt
port:
name: http