apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: unbound
  labels:
    app: unbound
spec:
  serviceName: "unbound"
  replicas: 1
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: unbound
  template:
    metadata:
      labels:
        app: unbound
    spec:
      containers:
        - name: unbound
          image: mvance/unbound-rpi:1.14.0
          ports:
            - name: svc-53-udp
              containerPort: 53
              protocol: UDP
            - name: svc-53-tcp
              containerPort: 53
              protocol: TCP
          resources:
            limits:
              memory: "1Gi"
              cpu: "1"
            requests:
              memory: "50Mi"
              cpu: "100m"
          volumeMounts:
            - mountPath: /opt/unbound/etc/unbound/a-records.conf
              name: unbound-a-records
              subPath: a-records.conf
          livenessProbe:
            tcpSocket:
              port: 53
            initialDelaySeconds: 30
            periodSeconds: 5
          readinessProbe:
            tcpSocket:
              port: 53
            initialDelaySeconds: 25
            periodSeconds: 5
      volumes:
        - name: unbound-a-records
          configMap:
            name: unbound-a-records-configmap
            items:
              - key: a-records
                path: a-records.conf
