Skip to content

Commit

Permalink
feat: deploy home assistant
Browse files Browse the repository at this point in the history
- [x] deploy basic home assistant
- [x] connect zigbee2mqtt dongle

Refs: #5
Signed-off-by: Wim de Groot <[email protected]>
  • Loading branch information
wim-de-groot committed Jun 25, 2024
1 parent e102707 commit 530accd
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
package-lock.json
.encrypt.pem
25 changes: 25 additions & 0 deletions apps/home-automation/home-assistant/configuration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes

#automation: !include automations.yaml
#script: !include scripts.yaml
#scene: !include scenes.yaml

homeassistant:
name: Naomi & Wim's Home
unit_system: metric
currency: EUR
country: NL
time_zone: "Europe/Amsterdam"
internal_url: "http://home-assistant.homelab.com:8123"

http:
server_host: 0.0.0.0
server_port: 8123
use_x_forwarded_for: true
trusted_proxies:
- 10.0.0.0/16
42 changes: 42 additions & 0 deletions apps/home-automation/home-assistant/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: home-assistant
spec:
replicas: 1
template:
spec:
securityContext:
runAsNonRoot: true
runAsUser: 26
runAsGroup: 1000
fsGroup: 1000
containers:
- name: home-assistant
image: homeassistant/home-assistant:2024.1
imagePullPolicy: IfNotPresent
env:
- name: TZ
value: "Europe/Amsterdam"
ports:
- containerPort: 8123
name: web
volumeMounts:
- mountPath: /config
name: home-assistant-data
- mountPath: /config/configuration.yaml
subPath: configuration.yaml
name: home-assistant-config
securityContext:
privileged: false
restartPolicy: Always
volumes:
- name: home-assistant-data
persistentVolumeClaim:
claimName: pvc-home-assistant-config
- name: home-assistant-config
configMap:
name: home-assistant-config
items:
- key: configuration.yaml
path: configuration.yaml
21 changes: 21 additions & 0 deletions apps/home-automation/home-assistant/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace: home-automation

resources:
- deployment.yaml
- service.yaml
- storage.yaml

configMapGenerator:
- name: home-assistant-config
files:
- configuration.yaml
options:
disableNameSuffixHash: true

labels:
- pairs:
app.kubernetes.io/name: home-assistant
includeSelectors: true
- pairs:
app.kubernetes.io/version: "2024.1"
includeSelectors: false
11 changes: 11 additions & 0 deletions apps/home-automation/home-assistant/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: home-assistant
spec:
ports:
- name: web
targetPort: web
port: 8123
protocol: TCP
type: ClusterIP
11 changes: 11 additions & 0 deletions apps/home-automation/home-assistant/storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-home-assistant-config
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
volumeMode: Filesystem

0 comments on commit 530accd

Please sign in to comment.