From 7528c3aa92915064e9fa8eca2c8c525d9be43c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=98eho=C5=99?= Date: Thu, 21 Nov 2024 21:01:04 +0100 Subject: [PATCH] Add test Home Assistant --- .../home-assistant/test/helmrelease.yaml | 129 ++++++++++++++++++ .../home-assistant/test/kustomization.yaml | 7 + 2 files changed, 136 insertions(+) create mode 100644 kubernetes/main/apps/home-automation/home-assistant/test/helmrelease.yaml create mode 100644 kubernetes/main/apps/home-automation/home-assistant/test/kustomization.yaml diff --git a/kubernetes/main/apps/home-automation/home-assistant/test/helmrelease.yaml b/kubernetes/main/apps/home-automation/home-assistant/test/helmrelease.yaml new file mode 100644 index 00000000..c009be66 --- /dev/null +++ b/kubernetes/main/apps/home-automation/home-assistant/test/helmrelease.yaml @@ -0,0 +1,129 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: &app hast +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.5.1 + interval: 30m + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + controllers: + hast: + pod: + securityContext: + runAsUser: 0 + runAsGroup: 0 + containers: + app: + image: &home-assistant-image + repository: ghcr.io/home-assistant/home-assistant + tag: 2024.11.1 + probes: + liveness: &probes + enabled: true + custom: true + spec: + httpGet: + path: /manifest.json + port: 8123 + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 + readiness: *probes + startup: *probes + resources: + requests: + cpu: 100m + memory: 2Gi + limits: + memory: 2Gi + code-server: + image: &code-server-image + repository: ghcr.io/coder/code-server + tag: 4.95.2 + args: [ + "--auth", "none", + "--user-data-dir", "/config/.vscode", + "--extensions-dir", "/config/.vscode", + "--port", "80", + "/config" + ] + resources: + requests: + cpu: 10m + memory: 2Gi + limits: + memory: 2Gi + lifecycle: + postStart: + exec: + command: + - /bin/sh + - -c + - | + ( + set -ex + apt update + apt install --yes dnsutils + apt install --yes iproute2 + apt install --yes inetutils-ping + apt install --yes inetutils-telnet + apt install --yes inetutils-traceroute + apt install --yes net-tools + ) > /tmp/postStart.log 2>&1 || true + service: + app: + controller: hast + ports: + http: + port: 8123 + code-server: + port: 80 + ingress: + app: + className: internal + hosts: + - host: &host hast.${SECRET_DOMAIN} + paths: + - path: / + service: + identifier: app + port: http + tls: + - hosts: + - *host + code-server: + className: internal + hosts: + - host: &host "hasx.${SECRET_DOMAIN}" + paths: + - path: / + service: + identifier: app + port: code-server + tls: + - hosts: + - *host + persistence: + config: + type: emptyDir + tmp: + type: emptyDir diff --git a/kubernetes/main/apps/home-automation/home-assistant/test/kustomization.yaml b/kubernetes/main/apps/home-automation/home-assistant/test/kustomization.yaml new file mode 100644 index 00000000..ce84014a --- /dev/null +++ b/kubernetes/main/apps/home-automation/home-assistant/test/kustomization.yaml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./helmrelease.yaml +