kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: traefik-ingress-controller
  namespace: kube-system
  labels:
    name: traefik-ingress-lb
    k8s-app: traefik-ingress-lb
  annotations:
    reloader.stakater.com/auto: "true"
spec:
  selector:
    matchLabels:
      name: traefik-ingress-lb
      k8s-app: traefik-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: traefik-ingress-lb
        name: traefik-ingress-lb
    spec:
      serviceAccountName: traefik-ingress-controller
      serviceAccount: traefik-ingress-controller
      terminationGracePeriodSeconds: 60
      containers:
        - image: traefik:v1.7
          name: traefik-ingress-lb
          imagePullPolicy: Always
          volumeMounts:
            - mountPath: /config
              name: config
            - mountPath: /acme
              name: acme
          ports:
            - name: http
              hostPort: 80
              containerPort: 80
            - name: https
              hostPort: 443
              containerPort: 443
            - name: admin
              containerPort: 8080
          securityContext:
            capabilities:
              drop:
                - ALL
              add:
                - NET_BIND_SERVICE
          args:
            - --api
            - --kubernetes
            - --logLevel=INFO
            - --insecureskipverify
            - --configfile=/config/traefik.toml
          env:
            - name: GODADDY_API_KEY
              valueFrom:
                secretKeyRef:
                  name: traefik-ingress-controller-godaddy
                  key: GODADDY_API_KEY
            - name: GODADDY_API_SECRET
              valueFrom:
                secretKeyRef:
                  name: traefik-ingress-controller-godaddy
                  key: GODADDY_API_SECRET
          livenessProbe:
            httpGet:
              path: /ping
              port: 8082
            initialDelaySeconds: 3
            periodSeconds: 3
            timeoutSeconds: 1
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: role
                      operator: In
                      values:
                        - data
                topologyKey: kubernetes.io/hostname
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      volumes:
        - configMap:
            defaultMode: 420
            name: traefik-conf
          name: config
        - name: acme
          persistentVolumeClaim:
            claimName: traefik-ingress-pvc
