apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    app.kubernetes.io/name: esphome
    app.kubernetes.io/version: 2021.9.3
  name: esphome
  namespace: homeassistant
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: esphome
  serviceName: esphome
  template:
    metadata:
      labels:
        app.kubernetes.io/name: esphome
        app.kubernetes.io/version: 2021.9.3
    spec:
      containers:
      - image: esphome/esphome:2021.9.3
        imagePullPolicy: IfNotPresent
        name: esphome
        ports:
        - containerPort: 6052
          name: http
        resources:
          limits:
            cpu: 800m
            memory: 600Mi
          requests:
            cpu: 400m
            memory: 350Mi
        volumeMounts:
        - mountPath: /config
          name: config
      hostNetwork: true
      restartPolicy: Always
      serviceAccountName: esphome
      volumes:
      - name: config
        persistentVolumeClaim:
          claimName: esphome-config
