From 8310abc5180fbd1c61bb90ef4e178fd5123f9068 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Sun, 28 Jan 2024 16:26:38 +0800 Subject: [PATCH] feat(hass): add vscode --- kube/deploy/apps/home-assistant/app/hr.yaml | 61 +++++++++++++++++++-- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/kube/deploy/apps/home-assistant/app/hr.yaml b/kube/deploy/apps/home-assistant/app/hr.yaml index 156bf8ec..d1b6c665 100644 --- a/kube/deploy/apps/home-assistant/app/hr.yaml +++ b/kube/deploy/apps/home-assistant/app/hr.yaml @@ -32,7 +32,7 @@ spec: #envFrom: # - secretRef: # name: "home-assistant-secrets" - securityContext: + securityContext: &sc readOnlyRootFilesystem: true allowPrivilegeEscalation: false capabilities: @@ -43,11 +43,48 @@ spec: limits: cpu: "3000m" memory: "1Gi" + vscode: + type: deployment + replicas: 1 + pod: + labels: + ingress.home.arpa/nginx-internal: "allow" + containers: + main: + image: + repository: "ghcr.io/coder/code-server" + tag: "4.20.1" + args: + - "--auth" + - "none" + - "--disable-telemetry" + - "--user-data-dir" + - "/config/.vscode" + - "--extensions-dir" + - "/config/.vscode" + - "--port" + - "8080" + - "/config" + env: + TZ: "${CONFIG_TZ}" + securityContext: *sc + resources: + requests: + cpu: "10m" + limits: + cpu: "500m" # I previously had a code-server that would eat cores + memory: "1Gi" service: main: ports: http: port: 8123 + vscode: + primary: false + controller: "vscode" + ports: + http: + port: 8080 ingress: main: enabled: true @@ -61,17 +98,29 @@ spec: service: name: main port: http + tls: &tls + - hosts: [*host] + vscode: + enabled: true + primary: false + className: "tailscale" + hosts: + - host: &host "hass-edit.${DNS_TS}" + paths: &paths + - path: / + pathType: Prefix + service: + name: vscode + port: http tls: - hosts: [*host] persistence: config: enabled: true existingClaim: "home-assistant-data" - advancedMounts: - main: - main: - - subPath: "config" - path: "/config" + globalMounts: + - subPath: "config" + path: "/config" tmp: enabled: true type: emptyDir