apiVersion: apps/v1
kind: Deployment
metadata:
  name: adguard-home
  namespace: adguard
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app.kubernetes.io/instance: adguard
      app.kubernetes.io/name: adguard-home
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: adguard
        app.kubernetes.io/name: adguard-home
    spec:
      containers:
      - args:
        - --config
        - /opt/adguardhome/conf/AdGuardHome.yaml
        - --work-dir
        - /opt/adguardhome/work
        - --no-check-update
        env:
        - name: TZ
          value: Europe/Berlin
        image: adguard/adguardhome:v0.107.7
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 3
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 3000
          timeoutSeconds: 1
        name: adguard-home
        ports:
        - containerPort: 53
          name: dns-tcp
          protocol: TCP
        - containerPort: 53
          name: dns-udp
          protocol: UDP
        - containerPort: 3000
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 3000
          timeoutSeconds: 1
        resources: {}
        startupProbe:
          failureThreshold: 30
          periodSeconds: 5
          successThreshold: 1
          tcpSocket:
            port: 3000
          timeoutSeconds: 1
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /opt/adguardhome/conf/
          name: adguard-home-config
      dnsPolicy: ClusterFirst

      restartPolicy: Always

      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 0777
          name: adguard-home-config
        name: adguard-home-config