migrate home assistant here

This commit is contained in:
Tobias Brunner 2024-02-25 21:05:41 +01:00
parent 2ed1f21750
commit d9a208e974
Signed by: tobru
SSH key fingerprint: SHA256:kywVhvCA+MIxL6eBgoQa+BfC/ROJqcfD2bpy1PR6Ebk
7 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,34 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: configuration
data:
configuration.yaml: |
homeassistant:
name: Camper
latitude: 47.38507000
longitude: 8.42581000
elevation: 400
unit_system: metric
time_zone: Europe/Zurich
auth_providers:
- type: trusted_networks
trusted_networks:
- 192.168.3.0/24
allow_bypass_login: true
- type: homeassistant
default_config:
http:
ip_ban_enabled: false
login_attempts_threshold: 5
use_x_forwarded_for: true
trusted_proxies:
- 10.42.0.0/16
automation: !include automations.yaml
mqtt: !include mqtt.yaml
sensor: !include sensors.yaml
template: !include templates.yaml

View file

@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: homeassistant
labels:
app: homeassistant
spec:
replicas: 1
selector:
matchLabels:
app: homeassistant
template:
metadata:
labels:
app: homeassistant
spec:
containers:
- name: homeassistant
image: docker.io/homeassistant/home-assistant:2024.2
env:
- name: DISABLE_JEMALLOC
value: "true"
ports:
- containerPort: 8123
resources:
limits:
cpu: "800m"
memory: 512Mi
volumeMounts:
- mountPath: /config
name: data
- mountPath: /config/configuration.yaml
subPath: configuration.yaml
name: config
volumes:
- name: config
configMap:
name: configuration
- name: data
persistentVolumeClaim:
claimName: data

View file

@ -0,0 +1,26 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod-desec
traefik.ingress.kubernetes.io/router.middlewares: kube-system-redirect-https@kubernetescrd
labels:
app: homeassistant
name: homeassistant
spec:
rules:
- host: home-assistant.camper.tobru.ch
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: homeassistant
port:
number: 80
tls:
- hosts:
- home-assistant.camper.tobru.ch
secretName: ingress-cert

View file

@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pvc.yaml
- configmap.yaml
- deployment.yaml
- service.yaml
- ingress.yaml

View file

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: local-path

View file

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: homeassistant
spec:
type: ClusterIP
selector:
app: homeassistant
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8123

View file

@ -0,0 +1,18 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: camper-homeassistant
namespace: argocd
spec:
project: apps-camper
source:
path: apps/camper/homeassistant
repoURL: https://git.tbrnt.ch/tobru/gitops-zurrli.git
targetRevision: HEAD
destination:
name: camper
namespace: homeassistant
syncPolicy:
syncOptions:
- ServerSideApply=true
- CreateNamespace=true