<p>I'm trying to setup an Ingress in my kubernetes cluster, with no success. I followed the instructions specified <a href="https://doc.traefik.io/traefik/v1.7/user-guide/kubernetes/" rel="nofollow noreferrer">here</a>. Basically I applied the following objects:</p>
<p>First, set the RBAC infrastructure:</p>
<pre><code>kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: traefik-ingress-controller
rules:
  - apiGroups:
      - &quot;&quot;
    resources:
      - services
      - endpoints
      - secrets
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - extensions
    resources:
      - ingresses
    verbs:
      - get
      - list
      - watch
  - apiGroups:
    - extensions
    resources:
    - ingresses/status
    verbs:
    - update
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  name: traefik-ingress-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
  name: traefik-ingress-controller
  namespace: kube-system

**Versions**: &lt;br&gt;
Kubectl, kubeadm, kubelet: 1.21.00&lt;br&gt;
Traefik 1.17
</code></pre>
<p>Then, created a DaemonSet with the Pods running the Ingress Controller:</p>
<pre><code>---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: traefik-ingress-controller
  namespace: kube-system
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: traefik-ingress-controller
  namespace: kube-system
  labels:
    k8s-app: traefik-ingress-lb
spec:
  selector:
    matchLabels:
      k8s-app: traefik-ingress-lb
      name: traefik-ingress-lb
  template:
    metadata:
      labels:
        k8s-app: traefik-ingress-lb
        name: traefik-ingress-lb
    spec:
      serviceAccountName: traefik-ingress-controller
      terminationGracePeriodSeconds: 60
      containers:
      - image: traefik:v1.7
        name: traefik-ingress-lb
        ports:
        - name: http
          containerPort: 80
          hostPort: 80
        - name: admin
          containerPort: 8080
          hostPort: 8080
        securityContext:
          capabilities:
            drop:
            - ALL
            add:
            - NET_BIND_SERVICE
        args:
        - --api
        - --kubernetes
        - --logLevel=INFO
---
kind: Service
apiVersion: v1
metadata:
  name: traefik-ingress-service
  namespace: kube-system
spec:
  selector:
    k8s-app: traefik-ingress-lb
  ports:
    - protocol: TCP
      port: 80
      name: web
    - protocol: TCP
      port: 8080
      name: admin
</code></pre>
<p>Now, I can access the Ingress web UI using port 8080 on one of my nodes, and I also know that port  80 directs traffic to the Ingress Controller, since when I run</p>
<pre><code>$ curl localhost:80
404 page not found
</code></pre>
<p>The problem is, that when trying to create a Ingress object, for some reason, the Ingress Controller doesn't redirect it to the backend service. Created the following objects:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: svc-myserver
spec:
  type: ClusterIP
  selector: 
    app: my-server
  ports:
  - protocol: TCP
    port: 80
    targetPort: 3000
</code></pre>
<p>This works, when running:</p>
<pre><code>$ curl 10.100.127.255
Hello world ! Version 1
</code></pre>
<p>Now, all there's to do is to create an Ingress that will forward traffic to the service:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-server-ingress
  namespace: kube-system
spec:
  rules:
  - host: myapp.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: svc-myserver
            port:
                   number: 80
</code></pre>
<p>Now when I run:</p>
<pre><code>$ kubectl get ingress -A
NAMESPACE     NAME                CLASS    HOSTS                 ADDRESS   PORTS   AGE
kube-system   my-server-ingress   &lt;none&gt;   myapp.com                       80      13h
</code></pre>
<p>You can see that the ADDRESS field is empty, and indeed when I try to browse to this <code>myapp.com</code> ( Updated it in the <code>/etc/hosts</code>) - I get 404.</p>
<p>What am I missing?</p>
<p><strong>Versions</strong> <br>
kubeadm, kubectl, kubelet - 1.21.00 <br>
traefik 1.17</p>

YoavKlein
<p>Ok I understood what the problem was: My Ingress object wasn't in the same namespace as of the Service. When examining the logs of the Ingress Controller's Pod, I got:</p>
<pre><code>time=&quot;2021-12-21T19:16:33Z&quot; level=error msg=&quot;Service not found for kube-system/svc-myserver&quot;
time=&quot;2021-12-21T19:16:33Z&quot; level=error msg=&quot;Service not found for kube-system/traefik-web-ui&quot;
time=&quot;2021-12-21T19:16:33Z&quot; level=error msg=&quot;Service not found for kube-system/traefik-web-ui&quot;
time=&quot;2021-12-21T19:16:33Z&quot; level=error msg=&quot;Service not found for kube-system/svc-myserver&quot;
time=&quot;2021-12-21T19:16:33Z&quot; level=error msg=&quot;Service not found for kube-system/traefik-web-ui&quot;
</code></pre>
<p>Once I moved it to the correct namespace, it worked like charm.</p>
<p>Thanks!</p>
