homeassistant config map

This commit is contained in:
Roger Oriol
2026-01-28 00:11:26 +01:00
parent fd8e011914
commit abc4d19ebb
3 changed files with 21 additions and 150 deletions

View File

@@ -1,4 +0,0 @@
http:
use_x_forwarded_for: true
trusted_proxies:
- 10.88.88.0/24

View File

@@ -1,146 +0,0 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: home-assistant
---
apiVersion: v1
kind: Service
metadata:
namespace: home-assistant
name: home-assistant
spec:
selector:
app: home-assistant
type: ClusterIP
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8123
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: home-assistant
name: home-assistant
labels:
app: home-assistant
spec:
replicas: 1
selector:
matchLabels:
app: home-assistant
template:
metadata:
labels:
app: home-assistant
spec:
containers:
- name: bluez
image: ghcr.io/mysticrenji/bluez-service:v1.0.0
securityContext:
privileged: true
- name: home-assistant
image: ghcr.io/mysticrenji/homeassistant-arm64:2023.3.0
resources:
requests:
memory: "256Mi"
limits:
memory: "512Mi"
ports:
- containerPort: 8123
volumeMounts:
- mountPath: /config
name: config
- mountPath: /config/configuration.yaml
subPath: configuration.yaml
name: configmap-file
- mountPath: /config/automations.yaml
subPath: automations.yaml
name: configmap-file
- mountPath: /media
name: media-volume
# - mountPath: /run/dbus
# name: d-bus
# readOnly: true
- mountPath: /dev/ttyUSB1
name: zigbee
#- mountPath: /dev/video0
# name: cam
securityContext:
privileged: true
capabilities:
add:
- NET_ADMIN
- NET_RAW
- SYS_ADMIN
hostNetwork: true
volumes:
- name: config
persistentVolumeClaim:
claimName: home-assistant-pvc
- name: media-volume
hostPath:
path: /tmp/media
- name: configmap-file
configMap:
name: home-assistant-configmap
# hostPath:
# path: /tmp/home-assistant
# type: DirectoryOrCreate
# - name: d-bus
# hostPath:
# path: /run/dbus
- name: zigbee
hostPath:
path: /dev/ttyACM0
#- name: cam
# hostPath:
# path: /dev/video0
---
kind: ConfigMap
apiVersion: v1
metadata:
name: home-assistant-configmap
namespace: home-assistant
data:
known_devices.yaml: |
automations.yaml: |
configuration.yaml: |-
default_config:
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- 10.10.0.0/16
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: home-assistant-pvc
labels:
app: home-assistant
namespace: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 9Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: zwavejs2mqtt-pvc
labels:
app: zwavejs2mqtt
namespace: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi

View File

@@ -19,6 +19,21 @@ spec:
port: 80
targetPort: 8123
---
apiVersion: v1
kind: ConfigMap
metadata:
namespace: home-assistant
name: home-assistant-config
data:
configuration.yaml: |
# Loads default set of integrations
default_config:
http:
use_x_forwarded_for: true
trusted_proxies:
- 10.88.88.0/24
---
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -49,6 +64,9 @@ spec:
volumeMounts:
- name: config
mountPath: /config
- name: configuration
mountPath: /config/configuration.yaml
subPath: configuration.yaml
- name: localtime
mountPath: /etc/localtime
readOnly: true
@@ -67,6 +85,9 @@ spec:
- name: config
persistentVolumeClaim:
claimName: home-assistant-config
- name: configuration
configMap:
name: home-assistant-config
- name: localtime
hostPath:
path: /etc/localtime