---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: traefik
spec:
  replicas: 1
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      app: traefik
  template:
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
      serviceAccountName: traefik-ingress-controller
      containers:
        - name: traefik
          image: traefik:v2.5.6
          args:
            - --entrypoints.web.address=:80
            - --providers.kubernetesingress
            - --api
            - --api.dashboard
          ports:
            - name: web
              containerPort: 80
