apiVersion: apps/v1
kind: Deployment
metadata:
  name: home-assistant
  labels:
    app.kubernetes.io/controller: main
    app.kubernetes.io/instance: home-assistant
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: home-assistant
    helm.sh/chart: home-assistant-5.0.1
  namespace: home-assistant
spec:
  revisionHistoryLimit: 3
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/controller: main
      app.kubernetes.io/name: home-assistant
      app.kubernetes.io/instance: home-assistant
  template:
    metadata:
      labels:
        app.kubernetes.io/controller: main
        app.kubernetes.io/instance: home-assistant
        app.kubernetes.io/name: home-assistant
    spec:
      enableServiceLinks: false
      serviceAccountName: home-assistant
      automountServiceAccountToken: false
      securityContext:
        fsGroup: 1000
        fsGroupChangePolicy: OnRootMismatch
      hostIPC: false
      hostNetwork: false
      hostPID: false
      dnsPolicy: ClusterFirst
      containers:
        - env:
            - name: TZ
              value: America/Chicago
            - name: PUID
              value: "1000"
            - name: PGID
              value: "1000"
            - name: DEFAULT_WORKSPACE
              value: /config
          envFrom:
            - secretRef:
                name: home-assistant-code-server-password
          image: ghcr.io/linuxserver/code-server:4.121.0-ls339@sha256:9aa515147487869f15421944069674ac9797ad4c0629041fd9a003f95b796d6c
          name: code-server
          volumeMounts:
            - mountPath: /config/home-assistant
              name: config
        - env:
            - name: TZ
              value: America/Chicago
          image: ghcr.io/home-assistant/home-assistant:2026.5.4@sha256:ceb1202133a5a036e8b03e20a10eb113186cc2f871968323c6fc6c3fc4205716
          name: main
          resources:
            requests:
              cpu: 1m
              memory: 400Mi
          volumeMounts:
            - mountPath: /config
              name: config
      volumes:
        - name: config
          persistentVolumeClaim:
            claimName: home-assistant-config
