add homeassistant
This commit is contained in:
1 parent
b045e93985
commit
4bcbf57049
8 files changed
+429
No files matched your search
@@ -0,0 +1,76 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: homeassistant-deployment
|
||||||
|
labels:
|
||||||
|
app: homeassistant
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: homeassistant
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: homeassistant
|
||||||
|
spec:
|
||||||
|
hostNetwork: true # <--- DAS IST NEU UND WICHTIG
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet # <--- WICHTIG FÜR DNS
|
||||||
|
containers:
|
||||||
|
- name: homeassistant
|
||||||
|
image: lscr.io/linuxserver/homeassistant:2026.4.4
|
||||||
|
# securityContext:
|
||||||
|
# privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: homeassistant-volume
|
||||||
|
mountPath: /config
|
||||||
|
ports:
|
||||||
|
- name: hmast-ui-port
|
||||||
|
containerPort: 8123
|
||||||
|
- name: hmast-devi-port
|
||||||
|
containerPort: 5353
|
||||||
|
volumes:
|
||||||
|
- name: homeassistant-volume
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/config
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: homeassistant-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: homeassistant
|
||||||
|
ports:
|
||||||
|
- name: homeassistant-http
|
||||||
|
protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 8123
|
||||||
|
- name: homeassistant-devices
|
||||||
|
protocol: TCP
|
||||||
|
port: 5353
|
||||||
|
targetPort: 5353
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: homeassistant-ingress
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: "letsencrypt-issuer"
|
||||||
|
spec:
|
||||||
|
ingressClassName: "traefik"
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- homeassistant.tap-tap.win
|
||||||
|
secretName: homeassistant-tls-secret
|
||||||
|
rules:
|
||||||
|
- host: homeassistant.tap-tap.win
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: homeassistant-service
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: homeassistant
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- homeassistant.yaml
|
||||||
|
- mosquitto.yaml
|
||||||
|
- zigbee2mqtt.yaml
|
||||||
|
- matter.yaml
|
||||||
|
- otbr.yaml
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: matter-server-deployment
|
||||||
|
labels:
|
||||||
|
app: matter-server
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: matter-server
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: matter-server
|
||||||
|
spec:
|
||||||
|
hostNetwork: true # Required for mDNS discovery to work effectively
|
||||||
|
# dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
dnsPolicy: Default
|
||||||
|
containers:
|
||||||
|
- name: matter-server
|
||||||
|
image: ghcr.io/home-assistant-libs/python-matter-server:stable
|
||||||
|
args:
|
||||||
|
- "--storage-path"
|
||||||
|
- "/data"
|
||||||
|
- "--paa-root-cert-dir"
|
||||||
|
- "/data/credentials"
|
||||||
|
- "--primary-interface"
|
||||||
|
- "ens18"
|
||||||
|
volumeMounts:
|
||||||
|
- name: matter-data
|
||||||
|
mountPath: /data
|
||||||
|
ports:
|
||||||
|
- name: matter-api
|
||||||
|
containerPort: 5580
|
||||||
|
volumes:
|
||||||
|
- name: matter-data
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/matter
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: matter-server-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: matter-server
|
||||||
|
ports:
|
||||||
|
- name: matter-api
|
||||||
|
protocol: TCP
|
||||||
|
port: 5580
|
||||||
|
targetPort: 5580
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-deployment
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: mosquitto
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: mosquitto
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: mosquitto
|
||||||
|
image: eclipse-mosquitto
|
||||||
|
volumeMounts:
|
||||||
|
- name: mosquitto-volume
|
||||||
|
mountPath: /mosquitto
|
||||||
|
- name: mosquitto-config
|
||||||
|
mountPath: /mosquitto/config/mosquitto.conf
|
||||||
|
volumes:
|
||||||
|
- name: mosquitto-volume
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/mosquitto
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
- name: mosquitto-config
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/mosquitto.conf
|
||||||
|
type: File
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: mosquitto-service
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: mosquitto
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 1883
|
||||||
|
targetPort: 1883
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: homeassistant
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: otbr-deployment
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: otbr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: otbr
|
||||||
|
spec:
|
||||||
|
hostNetwork: true # CRITICAL for Thread discovery
|
||||||
|
containers:
|
||||||
|
- name: otbr
|
||||||
|
image: ghcr.io/ownbee/hass-otbr-docker:latest
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
env:
|
||||||
|
- name: DEVICE
|
||||||
|
value: "/dev/ttyACM0" # Verify this on your host
|
||||||
|
- name: BAUDRATE
|
||||||
|
value: "460800"
|
||||||
|
- name: BACKBONE_IF
|
||||||
|
value: "ens18" # Your node's network interface
|
||||||
|
- name: OTBR_WEB_PORT
|
||||||
|
value: "30090"
|
||||||
|
- name: OTBR_REST_PORT
|
||||||
|
value: "30091"
|
||||||
|
- name: FIREWALL
|
||||||
|
value: "0"
|
||||||
|
- name: NAT64
|
||||||
|
value: "0"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /dev/ttyACM0
|
||||||
|
name: otbr-zbt2
|
||||||
|
- mountPath: /data
|
||||||
|
name: otbr-data
|
||||||
|
volumes:
|
||||||
|
- name: otbr-zbt2
|
||||||
|
hostPath:
|
||||||
|
path: /dev/serial/by-id/usb-Nabu_Casa_ZBT-2_DCB4D90C0AF4-if00
|
||||||
|
type: CharDevice
|
||||||
|
- name: otbr-data
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/otbr/thread
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: otbr-deployment
|
||||||
|
namespace: homeassistant
|
||||||
|
labels:
|
||||||
|
app: otbr
|
||||||
|
spec:
|
||||||
|
replicas: 0
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: otbr
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: otbr
|
||||||
|
spec:
|
||||||
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
containers:
|
||||||
|
- name: otbr
|
||||||
|
image: openthread/otbr:latest
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
# The official image uses arguments to configure the radio interface
|
||||||
|
env:
|
||||||
|
- name: OT_BR_NAME
|
||||||
|
value: "OTBR_K3S"
|
||||||
|
- name: BACKBONE_INTERFACE
|
||||||
|
value: "ens18"
|
||||||
|
- name: OT_THREAD_IF
|
||||||
|
value: "wpan0"
|
||||||
|
- name: OT_LOG_LEVEL
|
||||||
|
value: "7"
|
||||||
|
# Disable OTBR's firewall/NAT modifications so it doesn't break k3s host networking
|
||||||
|
- name: FIREWALL
|
||||||
|
value: "0"
|
||||||
|
- name: NAT64
|
||||||
|
value: "0"
|
||||||
|
# - name: OTBR_MDNS
|
||||||
|
# value: "mDNSResponder"
|
||||||
|
- name: OTBR_MDNS
|
||||||
|
value: "avahi"
|
||||||
|
args:
|
||||||
|
- "--radio-url"
|
||||||
|
- "spinel+hdlc+uart:///dev/ttyACM0?uart-baudrate=460800"
|
||||||
|
volumeMounts:
|
||||||
|
- name: usb-zbt2
|
||||||
|
mountPath: /dev/ttyACM0
|
||||||
|
- name: host-dbus
|
||||||
|
mountPath: /var/run/dbus
|
||||||
|
- name: otbr-data
|
||||||
|
mountPath: /var/lib/otbr-agent
|
||||||
|
# ports:
|
||||||
|
# # - name: web-gui
|
||||||
|
# # containerPort: 80
|
||||||
|
# - name: rest-api
|
||||||
|
# containerPort: 8081
|
||||||
|
|
||||||
|
# --- NEW: Sidecar to expose Web GUI safely on 30090 ---
|
||||||
|
- name: web-proxy
|
||||||
|
image: alpine/socat
|
||||||
|
args: ["tcp-listen:30090,fork,reuseaddr", "tcp:127.0.0.1:80"]
|
||||||
|
|
||||||
|
# --- NEW: Sidecar to expose REST API safely on 30081 ---
|
||||||
|
- name: rest-proxy
|
||||||
|
image: alpine/socat
|
||||||
|
args: ["tcp-listen:30091,fork,reuseaddr", "tcp:127.0.0.1:8081"]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: usb-zbt2
|
||||||
|
hostPath:
|
||||||
|
path: /dev/ttyACM0
|
||||||
|
- name: host-dbus
|
||||||
|
hostPath:
|
||||||
|
path: /var/run/dbus
|
||||||
|
- name: otbr-data
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/otbr
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
# ---
|
||||||
|
# apiVersion: v1
|
||||||
|
# kind: Service
|
||||||
|
# metadata:
|
||||||
|
# name: otbr-service
|
||||||
|
# namespace: homeassistant
|
||||||
|
# spec:
|
||||||
|
# type: NodePort # <--- Explicitly define the service as a NodePort
|
||||||
|
# selector:
|
||||||
|
# app: otbr
|
||||||
|
# ports:
|
||||||
|
# - name: otbr-rest
|
||||||
|
# protocol: TCP
|
||||||
|
# port: 8081
|
||||||
|
# targetPort: 8081
|
||||||
|
# - name: otbr-frontend
|
||||||
|
# protocol: TCP
|
||||||
|
# port: 30090
|
||||||
|
# targetPort: 80
|
||||||
|
# nodePort: 30090
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt-configmap
|
||||||
|
data:
|
||||||
|
TZ: Europe/Berlin
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt-deployment
|
||||||
|
labels:
|
||||||
|
app: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: zigbee2mqtt
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: zigbee2mqtt
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: zigbee2mqtt
|
||||||
|
image: ghcr.io/koenkk/zigbee2mqtt
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: zigbee2mqtt-configmap
|
||||||
|
volumeMounts:
|
||||||
|
- name: zigbee2mqtt-volume
|
||||||
|
mountPath: /app/data
|
||||||
|
- name: zigbee-config
|
||||||
|
mountPath: /app/data/configuration.yaml
|
||||||
|
- name: stick
|
||||||
|
mountPath: /dev/serial/by-id
|
||||||
|
ports:
|
||||||
|
- name: 2mqtt-frontend
|
||||||
|
containerPort: 8080
|
||||||
|
- name: 2mqtt-mqtt
|
||||||
|
containerPort: 1883
|
||||||
|
volumes:
|
||||||
|
- name: zigbee2mqtt-volume
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/zigbee2mqtt
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
- name: zigbee-config
|
||||||
|
hostPath:
|
||||||
|
path: /root/kubernetes/homeassistant/data/configuration2mqtt.yaml
|
||||||
|
type: File
|
||||||
|
- name: stick
|
||||||
|
hostPath:
|
||||||
|
path: /dev/serial/by-id
|
||||||
|
type: Directory
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: zigbee2mqtt-service
|
||||||
|
spec:
|
||||||
|
type: NodePort
|
||||||
|
selector:
|
||||||
|
app: zigbee2mqtt
|
||||||
|
ports:
|
||||||
|
- name: zigbee2mqtt-frontend
|
||||||
|
protocol: TCP
|
||||||
|
port: 80
|
||||||
|
targetPort: 8080
|
||||||
|
nodePort: 30080
|
||||||
|
- name: zigbee2mqtt-mqtt
|
||||||
|
protocol: TCP
|
||||||
|
port: 1883
|
||||||
|
targetPort: 1883
|
||||||
|
nodePort: 30081
|
||||||
|
---
|
||||||
|
# apiVersion: networking.k8s.io/v1
|
||||||
|
# kind: Ingress
|
||||||
|
# metadata:
|
||||||
|
# name: zigbee2mqtt-ingress
|
||||||
|
# spec:
|
||||||
|
# ingressClassName: "traefik"
|
||||||
|
# rules:
|
||||||
|
# - host: test.tap-tap.win
|
||||||
|
# http:
|
||||||
|
# paths:
|
||||||
|
# - path: /
|
||||||
|
# pathType: Prefix
|
||||||
|
# backend:
|
||||||
|
# service:
|
||||||
|
# name: zigbee2mqtt-service
|
||||||
|
# port:
|
||||||
|
# number: 80
|
||||||
Reference in new issue
Block a user