From b54f2c9c21e2715f427306904c2acf28f785107e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Sun, 9 Nov 2025 20:55:41 +0000 Subject: [PATCH] moved to casa kubernetes --- README.md | 28 ++------------- deploy/home-assistant-config-pvc.yaml | 13 +++++++ deploy/home-assistant-deployment.yaml | 39 +++++++++++++++++++++ deploy/home-assistant-external-service.yaml | 23 ++++++++++++ deploy/home-assistant-ingress.yaml | 22 ++++++++++++ deploy/home-assistant-namespace.yaml | 4 +++ docker-compose.yaml | 27 -------------- 7 files changed, 104 insertions(+), 52 deletions(-) create mode 100644 deploy/home-assistant-config-pvc.yaml create mode 100644 deploy/home-assistant-deployment.yaml create mode 100644 deploy/home-assistant-external-service.yaml create mode 100644 deploy/home-assistant-ingress.yaml create mode 100644 deploy/home-assistant-namespace.yaml delete mode 100644 docker-compose.yaml diff --git a/README.md b/README.md index 5daca77..e001698 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Home Assistant Welcome to my Home Assistant setup repository. -This repository documents and maintains the Home Assistant instance running in my home, hosted on homesrv01/casa server. -All essential Docker containers, such as MQTT and speech recognition, are hosted on the same server for seamless integration. +This repository documents and maintains the Home Assistant instance running in my home, hosted on casa server k3s cluster. +All essential containers, such as MQTT and speech recognition, are hosted on the same server for seamless integration. ## Table of Contents @@ -30,10 +30,6 @@ All essential Docker containers, such as MQTT and speech recognition, are hosted - [Time \& Date](#time--date) - [Xbox](#xbox) - [Setup](#setup) - - [Deploy and Updates](#deploy-and-updates) - - [Docker Volumes](#docker-volumes) - - [`has_config`](#has_config) -- [Development Environment](#development-environment) ## Devices @@ -259,23 +255,5 @@ Home Assistant authenticates with Xbox Live through OAuth2 using the Home Assist ## Setup -[Docker Compose file](./docker-compose.yaml). +[Check folder setup](./setup). -### Deploy and Updates - -[Git Action workflow](./.gitea/workflows/deploy.yml) - -- Automatically pull the latest Docker images daily. -- Execute `docker-compose up` to ensure the environment remains up-to-date and operational. - -### Docker Volumes - -#### `has_config` - -The `has_config` volume stores the Home Assistant configuration files. For more details, refer to the [Home Assistant configuration repository](/marcio.fernandes/homeassistant.config). - -## Development Environment - -Development and maintenance tasks are performed using Visual Studio Code. - -The Docker context is set to the host [homesrv01.dev.lan](/marcio.fernandes/homesrv01.dev.lan) for seamless integration and management. diff --git a/deploy/home-assistant-config-pvc.yaml b/deploy/home-assistant-config-pvc.yaml new file mode 100644 index 0000000..c90e49c --- /dev/null +++ b/deploy/home-assistant-config-pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: home-assistant-config + namespace: home-assistant +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 8Gi + storageClassName: local-path + \ No newline at end of file diff --git a/deploy/home-assistant-deployment.yaml b/deploy/home-assistant-deployment.yaml new file mode 100644 index 0000000..a337d78 --- /dev/null +++ b/deploy/home-assistant-deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: home-assistant + namespace: home-assistant + labels: + app: home-assistant +spec: + replicas: 1 + selector: + matchLabels: + app: home-assistant + template: + metadata: + labels: + app: home-assistant + spec: + hostNetwork: true + containers: + - name: home-assistant + image: "homeassistant/home-assistant" + volumeMounts: + - name: home-assistant-config + mountPath: /config + resources: + requests: + memory: "512Mi" + cpu: "400m" + limits: + memory: "700Mi" + cpu: "1000m" + volumes: + - name: home-assistant-config + persistentVolumeClaim: + claimName : home-assistant-config + + + + \ No newline at end of file diff --git a/deploy/home-assistant-external-service.yaml b/deploy/home-assistant-external-service.yaml new file mode 100644 index 0000000..89b7252 --- /dev/null +++ b/deploy/home-assistant-external-service.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: Service +metadata: + name: home-assistant-external + namespace: home-assistant +spec: + clusterIP: None + ports: + - port: 8123 + protocol: TCP + +--- + +apiVersion: v1 +kind: Endpoints +metadata: + name: home-assistant-external + namespace: home-assistant +subsets: + - addresses: + - ip: 192.168.14.9 # Replace with your actual external IP + ports: + - port: 8123 \ No newline at end of file diff --git a/deploy/home-assistant-ingress.yaml b/deploy/home-assistant-ingress.yaml new file mode 100644 index 0000000..259786f --- /dev/null +++ b/deploy/home-assistant-ingress.yaml @@ -0,0 +1,22 @@ + +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: home-assistant + namespace: home-assistant +spec: + entryPoints: + - websecure + routes: + - match: Host(`casa.limbosolutions.com`) + kind: Rule + services: + - name: home-assistant-external + port: 8123 + - match: Host(`has.casa.limbosolutions.com`) + kind: Rule + services: + - name: home-assistant-external + port: 8123 + tls: + secretName: casa-limbosolutions-com-tls \ No newline at end of file diff --git a/deploy/home-assistant-namespace.yaml b/deploy/home-assistant-namespace.yaml new file mode 100644 index 0000000..93acd9a --- /dev/null +++ b/deploy/home-assistant-namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: home-assistant \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index 7cb1ebd..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,27 +0,0 @@ -services: - app: - container_name: homeassistant-app - image: "homeassistant/home-assistant" - volumes: - - app_config:/config - - /etc/localtime:/etc/localtime:ro - restart: unless-stopped - networks: - has: - reverseproxy_public: - ports: - - 8080:80 - - 5683:5683/udp # SELLY INTEGRATION - #devices: - #- /dev/ttyUSB0:/dev/ttyUSB0 #zigbee - -volumes: - app_config: - name: has_app_config - external: true - -networks: - has: - reverseproxy_public: - external: true -