apiVersion: apps/v1
kind: Deployment
metadata:
  name: home-assistant
  labels:
    app: home-assistant
spec:
  selector:
    matchLabels:
      app: home-assistant
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: home-assistant
    spec:
      containers:
      - image: registry.homelab.dsb.dev/homeassistant/home-assistant:2021.1.5
        name: home-assistant
        imagePullPolicy: IfNotPresent
        readinessProbe:
          tcpSocket:
            port: 8123
        volumeMounts:
          - mountPath: /config/configuration.yaml
            subPath: configuration.yaml
            name: home-assistant-config
          - mountPath: /config/scripts.yaml
            subPath: scripts.yaml
            name: home-assistant-config
          - mountPath: /config/ui-lovelace.yaml
            subPath: ui-lovelace.yaml
            name: home-assistant-config
          - mountPath: /config/scenes.yaml
            subPath: scenes.yaml
            name: home-assistant-config
          - mountPath: /config/secrets.yaml
            subPath: secrets.yaml
            name: home-assistant-secret
          - mountPath: /config/automations.yaml
            subPath: automations.yaml
            name: home-assistant-config
          - mountPath: /config/groups.yaml
            subPath: groups.yaml
            name: home-assistant-config
          - mountPath: /config/.storage
            name: home-assistant
      volumes:
      - name: home-assistant-config
        configMap:
          name: home-assistant
      - name: home-assistant-secret
        secret:
          secretName: home-assistant
      - name: home-assistant
        persistentVolumeClaim:
          claimName: home-assistant
