Files
Cluster/homeassistant/otbr.yaml.bak
T
2026-10-20 15:47:57 +02:00

101 lines
2.7 KiB
Plaintext

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