feat: deploy start using kustomization
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 17s
All checks were successful
Casa Home Assistant CI/CD Pipeline / deploy (push) Successful in 17s
This commit is contained in:
@@ -37,12 +37,6 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy Home Assistant
|
- name: Deploy Home Assistant
|
||||||
shell: bash
|
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: |
|
run: |
|
||||||
kubectl apply -f ./deploy/deployment.yaml \
|
./ops-scripts/apply-app.sh
|
||||||
&& envsubst < ./deploy/service.template.yaml | kubectl apply -f -
|
|
||||||
|
|
||||||
@@ -254,4 +254,6 @@ Home Assistant authenticates with Xbox Live through OAuth2 using the Home Assist
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
[Deploy documentation](./deploy/README.md).
|
``` bash
|
||||||
|
./ops-scripts/apply-app.sh
|
||||||
|
```
|
||||||
|
|||||||
7
deploy/app/kustomization.yaml
Normal file
7
deploy/app/kustomization.yaml
Normal 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
12
deploy/app/pvc.yaml
Normal 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
|
||||||
@@ -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
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
@@ -44,7 +28,7 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
env:
|
env:
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: Europe/Lisbon # set timezone
|
value: Europe/Lisbon
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: home-assistant-config
|
- name: home-assistant-config
|
||||||
mountPath: /config
|
mountPath: /config
|
||||||
@@ -55,6 +39,7 @@ spec:
|
|||||||
limits:
|
limits:
|
||||||
memory: "724Mi"
|
memory: "724Mi"
|
||||||
cpu: "1000m"
|
cpu: "1000m"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: home-assistant-config
|
- name: home-assistant-config
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
5
ops-scripts/apply-app.sh
Executable file
5
ops-scripts/apply-app.sh
Executable 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
5
ops-scripts/apply-infra.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
echo "Executing infra deploy."
|
||||||
|
|
||||||
|
kubectl kustomize deploy/infra | kubectl apply -f -
|
||||||
Reference in New Issue
Block a user