feat: deploy start using kustomization
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 17s

This commit is contained in:
2025-12-07 17:12:05 +00:00
parent dbecd67471
commit a079ae8ffd
12 changed files with 35 additions and 25 deletions

View File

@@ -37,12 +37,6 @@ jobs:
- name: Deploy Home Assistant
shell: bash
env:
ENDPOINT_IP: "${{ secrets.CASA_HOMEASSISTANT_ENDPOINT_IP }}"
SERVICE_PORT: "${{ secrets.CASA_HOMEASSISTANT_ENDPOINT_SERVICE_PORT }}"
INGRESS_ROUTES_MATCH: "${{ secrets.CASA_HOMEASSISTANT_INGRESS_ROUTES_MATCH }}"
INGRESS_TLS_SECRET_NAME: "${{ secrets.CASA_HOMEASSISTANT_INGRESS_TLS_SECRET_NAME }}"
run: |
kubectl apply -f ./deploy/deployment.yaml \
&& envsubst < ./deploy/service.template.yaml | kubectl apply -f -
./ops-scripts/apply-app.sh

View File

@@ -254,4 +254,6 @@ Home Assistant authenticates with Xbox Live through OAuth2 using the Home Assist
## Setup
[Deploy documentation](./deploy/README.md).
``` bash
./ops-scripts/apply-app.sh
```

View File

@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pvc.yaml
- statefulset.yaml
generatorOptions:
disableNameSuffixHash: true

12
deploy/app/pvc.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: home-assistant-config
namespace: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: local-path

View File

@@ -1,19 +1,3 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: home-assistant-config
namespace: home-assistant
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: local-path
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -44,7 +28,7 @@ spec:
imagePullPolicy: Always
env:
- name: TZ
value: Europe/Lisbon # set timezone
value: Europe/Lisbon
volumeMounts:
- name: home-assistant-config
mountPath: /config
@@ -55,6 +39,7 @@ spec:
limits:
memory: "724Mi"
cpu: "1000m"
volumes:
- name: home-assistant-config
persistentVolumeClaim:

5
ops-scripts/apply-app.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -e
echo "Executing app deploy."
kubectl kustomize deploy/app | kubectl apply -f -

5
ops-scripts/apply-infra.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
set -e
echo "Executing infra deploy."
kubectl kustomize deploy/infra | kubectl apply -f -