title: command traefik error: flag needs an argument: -kubernetes
body: <p>When kubernetes(v.1.15.2) start Traefik(2.x) pods,the error output is:</p>
  
  <pre><code>2020/01/29 07:40:52 command traefik error: flag needs an argument: -kubernetes
  </code></pre>
  
  <p>this is my daemon set yaml:</p>
  
  <pre><code>{
    "kind": "DaemonSet",
    "apiVersion": "extensions/v1beta1",
    "metadata": {
      "name": "traefik-ingress-lb",
      "namespace": "kube-system",
      "selfLink": "/apis/extensions/v1beta1/namespaces/kube-system/daemonsets/traefik-ingress-lb",
      "uid": "6aee6973-681d-4a8e-814b-2d279ed00ffd",
      "resourceVersion": "12736249",
      "generation": 3,
      "creationTimestamp": "2020-01-28T14:49:22Z",
      "labels": {
        "k8s-app": "traefik-ingress-lb"
      }
    },
    "spec": {
      "selector": {
        "matchLabels": {
          "k8s-app": "traefik-ingress-lb",
          "name": "traefik-ingress-lb"
        }
      },
      "template": {
        "metadata": {
          "creationTimestamp": null,
          "labels": {
            "k8s-app": "traefik-ingress-lb",
            "name": "traefik-ingress-lb"
          }
        },
        "spec": {
          "containers": [
            {
              "name": "traefik-ingress-lb",
              "image": "traefik",
              "args": [
                "--web",
                "--web.address=:8580",
                "--kubernetes"
              ],
              "ports": [
                {
                  "name": "http",
                  "hostPort": 80,
                  "containerPort": 80,
                  "protocol": "TCP"
                },
                {
                  "name": "admin",
                  "hostPort": 8580,
                  "containerPort": 8580,
                  "protocol": "TCP"
                }
              ],
              "resources": {
                "limits": {
                  "cpu": "200m",
                  "memory": "30Mi"
                },
                "requests": {
                  "cpu": "100m",
                  "memory": "20Mi"
                }
              },
              "terminationMessagePath": "/dev/termination-log",
              "terminationMessagePolicy": "File",
              "imagePullPolicy": "Always"
            }
          ],
          "restartPolicy": "Always",
          "terminationGracePeriodSeconds": 60,
          "dnsPolicy": "ClusterFirst",
          "nodeSelector": {
            "edgenode": "true"
          },
          "serviceAccountName": "ingress",
          "serviceAccount": "ingress",
          "hostNetwork": true,
          "securityContext": {},
          "schedulerName": "default-scheduler"
        }
      },
      "updateStrategy": {
        "type": "OnDelete"
      },
      "templateGeneration": 3,
      "revisionHistoryLimit": 10
    },
    "status": {
      "currentNumberScheduled": 3,
      "numberMisscheduled": 0,
      "desiredNumberScheduled": 3,
      "numberReady": 0,
      "observedGeneration": 3,
      "updatedNumberScheduled": 3,
      "numberUnavailable": 3
    }
  }
  </code></pre>
  
  <p>and this is my ingress-rbac.yaml:</p>
  
  <pre><code>apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: ingress
    namespace: kube-system
  
  ---
  
  kind: ClusterRoleBinding
  apiVersion: rbac.authorization.k8s.io/v1beta1
  metadata:
    name: ingress
  subjects:
    - kind: ServiceAccount
      name: ingress
      namespace: kube-system
  roleRef:
    kind: ClusterRole
    name: cluster-admin
    apiGroup: rbac.authorization.k8s.io
  </code></pre>
  
  <p>this is ingress.yaml:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: traefik-ingress
    namespace: default
  spec:
    rules:
    - host: traefik.nginx.io
      http:
        paths:
        - path: /
          backend:
            serviceName: my-nginx
            servicePort: 80
    - host: traefik.frontend.io
      http:
        paths:
        - path: /
          backend:
            serviceName: frontend
            servicePort: 80
  </code></pre>
  
  <p>the pods shows: <code>Back-off restarting failed container</code> . <a href="https://i.stack.imgur.com/nrIob.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nrIob.png" alt="enter image description here"></a>what should I do to fix this?</p>