Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Home Assistant Kubernetes manifest
---
apiVersion: v1
kind: Secret
metadata:
name: mysql-recorder-pass
namespace: homeassistant
type: Opaque
data:
password: <REDACTED>
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: homeassistant
name: homeassistant
namespace: homeassistant
spec:
replicas: 1
selector:
matchLabels:
app: homeassistant
template:
metadata:
labels:
app: homeassistant
spec:
nodeName: princess-celestia
volumes:
- name: ha-storage
nfs:
server: mnemosyne.arkane-systems.lan
path: "/swarm/harmony/homeassistant/ha"
- name: ha-mysql-storage
hostPath:
path: /opt/ha-mysql
type: DirectoryOrCreate
containers:
- image: ghcr.io/home-assistant/home-assistant:stable
name: home-assistant
volumeMounts:
- mountPath: "/config"
name: ha-storage
- image: mysql:latest
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mysql-recorder-pass
key: password
volumeMounts:
- name: ha-mysql-storage
mountPath: /var/lib/mysql
---
apiVersion: v1
kind: Service
metadata:
name: homeassistant
namespace: homeassistant
spec:
selector:
app: homeassistant
ports:
- protocol: TCP
port: 8123
name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: homeassistant-ingress
namespace: homeassistant
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: 'websecure'
traefik.ingress.kubernetes.io/router.tls: 'true'
spec:
rules:
- host: jeeves.harmony.arkane-systems.lan
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: homeassistant
port:
number: 8123
- host: automation.arkane-systems.net
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: homeassistant
port:
number: 8123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment