From f841ae6c0e3ebc71dd08e5564215df448c3c9a7e Mon Sep 17 00:00:00 2001 From: Ava Affine Date: Tue, 22 Jul 2025 23:06:12 -0700 Subject: [PATCH] remove homeassistant proxy and rely fully on the container deployment Signed-off-by: Ava Affine --- templates/homeassistant.yaml | 84 +++++++++++++++++++----------------- templates/routing.yaml | 12 +----- values.yaml | 3 ++ 3 files changed, 49 insertions(+), 50 deletions(-) diff --git a/templates/homeassistant.yaml b/templates/homeassistant.yaml index 26bd206..1a9d448 100644 --- a/templates/homeassistant.yaml +++ b/templates/homeassistant.yaml @@ -17,7 +17,7 @@ spec: apiVersion: apps/v1 kind: Deployment metadata: - name: homeassistant-proxy + name: homeassistant spec: replicas: 1 selector: @@ -29,50 +29,54 @@ spec: app: homeassistant spec: containers: - - name: nginx - image: nginx + - name: homeassistant + image: "ghcr.io/home-assistant/home-assistant:stable" + securityContext: + privileged: true ports: - name: http-port containerPort: 8123 + env: + - name: TZ + value: "America/Los_Angeles" volumeMounts: - - name: config-volume - mountPath: /etc/nginx/nginx.conf - subPath: nginx.conf + - name: config-directory + mountPath: /config + - name: zigbee-dongle + mountPath: /dev/ttyUSB0 volumes: - - name: config-volume - configMap: - name: homeassistant-proxy-nginx-conf - items: - - key: nginx.conf - path: nginx.conf + - name: config-directory + persistentVolumeClaim: + claimName: homeassistant-pvc + - name: zigbee-dongle + hostPath: + path: /dev/ttyUSB0 --- apiVersion: v1 -kind: ConfigMap +kind: PersistentVolume metadata: - name: homeassistant-proxy-nginx-conf - namespace: default -data: - nginx.conf: | - worker_processes auto; - events { - worker_connections 2048; - } - http { - map $http_upgrade $connection_upgrade { - default upgrade; - '' close; - } - server { - error_log stdout; - access_log stdout; - - listen 8123; - listen [::]:8123; - proxy_buffering off; - location / { - proxy_pass http://172.30.32.1:8123; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection $connection_upgrade; - } - } - } + name: homeassistant-pv + labels: + pvc_type: homeassistant-pv +spec: + capacity: + storage: 1000Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: {{ .Values.homeassistant.path }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: homeassistant-pvc +spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + storageClassName: "" + volumeName: homeassistant-pv + resources: + requests: + storage: 1000Gi diff --git a/templates/routing.yaml b/templates/routing.yaml index 5b7cc2a..59e445f 100644 --- a/templates/routing.yaml +++ b/templates/routing.yaml @@ -1,11 +1,3 @@ -kind: ConfigMap -apiVersion: v1 -metadata: - name: nginx-ingress -data: - otel-exporter-endpoint: "observability:4317" - otel-trace-in-http: "true" ---- apiVersion: v1 kind: Secret metadata: @@ -44,9 +36,9 @@ spec: - cloud.sunnypup.io - office.sunnypup.io - echo.sunnypup.io - - home.sunnypup.io - hephaestus.sunnypup.io - mimir.sunnypup.io + - annwn.sunnypup.io --- apiVersion: cert-manager.io/v1 kind: Certificate @@ -170,7 +162,7 @@ metadata: labels: acme.cert-manager.io/http01-solver: "true" spec: - host: home.sunnypup.io + host: annwn.sunnypup.io tls: cert-manager: cluster-issuer: letsencrypt diff --git a/values.yaml b/values.yaml index 4884ed2..8513e2d 100644 --- a/values.yaml +++ b/values.yaml @@ -77,3 +77,6 @@ observability: grafana: "/srv/sunnypup/otel/grafana" p8s: "/srv/sunnypup/otel/p8s" pyroscope: "/srv/sunnypup/otel/pyroscope" + +homeassistant: + path: "/srv/sunnypup/homeassistant"