Traefik 404 for every services - kubernetes ingress

Hello, I'm trying to setup traefik v1.7.30 ingress as service but I always get the error 404.
I would use only port 80, no certificate yet, no separated domains.
The services are all reachable from the nodes with curl but via traefik always threw a 404 error. The traefik dashboard looks working, all paths are blue. No red :slight_smile:
kubernetes version: 1.6

My installation details are here.

kind: Deployment
apiVersion: apps/v1
metadata:
  name: traefik-ingress-controller
  namespace: default
  labels:
    k8s-app: traefik-ingress-lb
spec:
  replicas: 1
  selector:
    matchLabels:
      k8s-app: 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.30
        name: traefik-ingress-lb
        ports:
        - name: http
          containerPort: 80
        - name: admin
          containerPort: 8080
        args:
        - --api
        - --kubernetes
        - --logLevel=DEBUG
---
kind: Service
apiVersion: v1
metadata:
  name: traefik-ingress-service
  namespace: default
  annotations:
    metallb.universe.tf/address-pool: mmas-ip-space
spec:
  selector:
    k8s-app: traefik-ingress-lb
  ports:
    - protocol: TCP
      port: 80
      name: web
    - protocol: TCP
      port: 8080
      name: admin
  type: LoadBalancer
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: webmust-ing
  namespace: default
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
    - http:
        paths:
        - path: /tpath
          backend:
            serviceName: webmust-service
            servicePort: 80
        - path: /helloservice
          backend:
            serviceName: hellok8s-service
            servicePort: 8080
        - path: /nginx
          backend:
            serviceName: test-ngnix-service
            servicePort: 80
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                       AGE
hellok8s-service          ClusterIP      10.100.168.2     <none>        8080/TCP                      5d21h
kubernetes                ClusterIP      10.96.0.1        <none>        443/TCP                       133d
test-ngnix-service        ClusterIP      10.100.173.151   <none>        80/TCP                        11h
traefik-ingress-service   LoadBalancer   10.102.169.227   10.24.33.32   80:30887/TCP,8080:30463/TCP   17h
webmust-service           ClusterIP      10.101.186.125   <none>        80/TCP                        10h

Logs from traefik

time="2021-05-27T07:34:17Z" level=debug msg="vulcand/oxy/forward/http: Round trip: http://10.23.37.21:8080, code: 404, Length: 0, duration: 2.157719ms"
time="2021-05-27T07:34:17Z" level=debug msg="vulcand/oxy/forward/http: completed ServeHttp on request" Request="{\"Method\":\"HEAD\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"10.23.37.21:8080\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.29.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"10.24.33.32\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.23.37.0:40790\",\"RequestURI\":\"/tpath/webclient-ares\",\"TLS\":null}"
time="2021-05-27T07:34:17Z" level=debug msg="vulcand/oxy/forward: completed ServeHttp on request" Request="{\"Method\":\"HEAD\",\"URL\":{\"Scheme\":\"http\",\"Opaque\":\"\",\"User\":null,\"Host\":\"10.23.37.21:8080\",\"Path\":\"\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.29.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"10.24.33.32\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.23.37.0:40790\",\"RequestURI\":\"/tpath/webclient-ares\",\"TLS\":null}"
time="2021-05-27T07:34:17Z" level=debug msg="vulcand/oxy/roundrobin/rr: completed ServeHttp on request" Request="{\"Method\":\"HEAD\",\"URL\":{\"Scheme\":\"\",\"Opaque\":\"\",\"User\":null,\"Host\":\"\",\"Path\":\"/tpath/webclient-ares\",\"RawPath\":\"\",\"ForceQuery\":false,\"RawQuery\":\"\",\"Fragment\":\"\",\"RawFragment\":\"\"},\"Proto\":\"HTTP/1.1\",\"ProtoMajor\":1,\"ProtoMinor\":1,\"Header\":{\"Accept\":[\"*/*\"],\"User-Agent\":[\"curl/7.29.0\"]},\"ContentLength\":0,\"TransferEncoding\":null,\"Host\":\"10.24.33.32\",\"Form\":null,\"PostForm\":null,\"MultipartForm\":null,\"Trailer\":null,\"RemoteAddr\":\"10.23.37.0:40790\",\"RequestURI\":\"/tpath/webclient-ares\",\"TLS\":null}"
 kubectl describe pod webmust-deployment-76c9949499-lcmsd | grep IP
IP:             10.23.37.21

But /webclient-ares/ path should response with the login page. I tested with NodePort service it works and the ClusterIP service also response with http 200 to curl. I guess something is missing from my traefik config

ok, so when I've added the following annotations the helloservice and the nginx works

    ingress.kubernetes.io/protocol: http
    traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip

but the most important one still not :frowning:
I find this in the log

time="2021-05-27T08:08:01Z" level=debug msg="Wiring frontend /tpath to entryPoint http"
time="2021-05-27T08:08:01Z" level=debug msg="Creating backend /tpath"
time="2021-05-27T08:08:01Z" level=debug msg="Creating load-balancer wrr"
time="2021-05-27T08:08:01Z" level=debug msg="Creating server webmust-deployment-76c9949499-lcmsd at http://10.23.37.21:8080 with weight 1"
time="2021-05-27T08:08:01Z" level=debug msg="Creating route /tpath PathPrefixStrip:/tpath"
time="2021-05-27T08:08:01Z" level=info msg="Server configuration reloaded on :80"
time="2021-05-27T08:08:01Z" level=info msg="Server configuration reloaded on :8080"
time="2021-05-27T08:08:01Z" level=debug msg="Received Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:01Z" level=warning msg="Endpoints not available for kube-system/webmust-service"
time="2021-05-27T08:08:01Z" level=debug msg="Skipping Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:01Z" level=debug msg="Received Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:01Z" level=warning msg="Endpoints not available for kube-system/webmust-service"
time="2021-05-27T08:08:01Z" level=debug msg="Skipping Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:01Z" level=debug msg="Received Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:01Z" level=warning msg="Endpoints not available for kube-system/webmust-service"
time="2021-05-27T08:08:01Z" level=debug msg="Skipping Kubernetes event kind *v1.Endpoints"
time="2021-05-27T08:08:02Z" level=debug msg="Received Kubernetes event kind *v1.Endpoints"

So everything is in the default namespace. Why is it searching in the kube-system ???
If I refresh the page 2-3 times, it works. But why it always want to find an endpoint in the wrong namespace?

Hello @gerrga

Thanks a lot for using Traefik.

The first question before diving into your issue - is there any specific reason why you selected Traefik v1?

The current Traefik version is 2.4.8.

V2 in general is completely redesigned and I highly recommend using V2. Based on your question I can assume that you are starting with Traefik so it is even more efficient to switch just now to V2.

Recently I've recorded a webinar Getting started with Traefik on Kubernetes when I explained the concepts of Kubernetes Ingress and where Traefik is positioned in the stack.

All source code that I use during the workshop is available on my Github Repo.

Hello @jakubhajek Thank you for your answer. I will try the V2 and the links. Hopefully I can sort out the issue