homeassistant

Signed-off-by: Michael Thomson <michael@michaelthomson.dev>
This commit is contained in:
2024-10-10 15:12:34 -04:00
parent 195b668577
commit 806fb8c428
8 changed files with 123 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: homeassistant
namespace: flux-system
spec:
interval: 15m
path: ./homeassistant
prune: true # remove any elements later removed from the above path
timeout: 2m # if not set, this defaults to interval duration, which is 1h
sourceRef:
kind: GitRepository
name: flux-system
healthChecks:
- apiVersion: apps/v1
kind: Deployment
name: homeassistant
namespace: homeassistant

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: homeassistant

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: homeassistant-config
namespace: homeassistant
data:
PUID: "1000"
PGID: "1000"

View File

@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: homeassistant
namespace: homeassistant
spec:
selector:
matchLabels:
app: homeassistant
template:
metadata:
labels:
app: homeassistant
spec:
containers:
- name: homeassistant
image: lscr.io/linuxserver/homeassistant:latest
imagePullPolicy: Always
envFrom:
- configMapRef:
name: homeassistant-config
optional: false
ports:
- containerPort: 8123
name: http
protocol: TCP
volumeMounts:
- name: config
mountPath: /config
volumes:
- name: config
persistentVolumeClaim:
claimName: homeassistant-config

View File

@@ -0,0 +1,12 @@
apiVersion: externaldns.k8s.io/v1alpha1
kind: DNSEndpoint
metadata:
name: ha.michaelthomson.dev
namespace: homeassistant
spec:
endpoints:
- dnsName: ha.michaelthomson.dev
recordTTL: 180
recordType: CNAME
targets:
- server.michaelthomson.dev

View File

@@ -0,0 +1,24 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: homeassistant
namespace: homeassistant
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
rules:
- host: ha.michaelthomson.dev
http:
paths:
- pathType: ImplementationSpecific
path: /
backend:
service:
name: homeassistant
port:
name: http
tls:
- hosts:
- ha.michaelthomson.dev
secretName: letsencrypt-wildcard-cert-michaelthomson.dev

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: homeassistant-config
namespace: homeassistant
spec:
resources:
requests:
storage: 8Gi
storageClassName: longhorn
accessModes:
- ReadWriteOnce

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: homeassistant
namespace: homeassistant
spec:
selector:
app: homeassistant
ports:
- port: 80
targetPort: http
name: http