apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: home-assistant
  name: ha-home-assistant
  namespace: ha
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app.kubernetes.io/instance: ha
      app.kubernetes.io/name: home-assistant
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: ha
        app.kubernetes.io/name: home-assistant
    spec:
      containers:
      - image: homeassistant/armhf-homeassistant
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /
            port: api
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        name: home-assistant
        ports:
        - containerPort: 8123
#          hostPort: 8123
          name: api
          protocol: TCP
        readinessProbe:
          failureThreshold: 5
          httpGet:
            path: /
            port: api
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 10
        resources: {}
        securityContext:
          runAsUser: 0
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /config
          name: config
      - env:
        - name: HC_HASS_API_PASSWORD
          valueFrom:
            secretKeyRef:
              key: hass-api-password
              name: ha-home-assistant-configurator
        - name: HC_USERNAME
          valueFrom:
            secretKeyRef:
              key: username
              name: ha-home-assistant-configurator
        - name: HC_PASSWORD
          valueFrom:
            secretKeyRef:
              key: password
              name: ha-home-assistant-configurator
        - name: HC_HASS_API
          value: http://home-assistant.local:8123/api/
        - name: HC_BASEPATH
          value: /config
        - name: HC_ENFORCE_BASEPATH
          value: "true"
        image: causticlab/hass-configurator-docker:0.3.5-arm
        imagePullPolicy: IfNotPresent
        name: configurator
        ports:
        - containerPort: 3218
#          hostPort: 3218
          name: configurator
          protocol: TCP
        resources: {}
        securityContext:
          runAsUser: 0
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /config
          name: config
      dnsPolicy: ClusterFirstWithHostNet
      hostNetwork: true
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: ha-home-assistant-0