Traefik v2 /ping returning 404

I am trying to setup /ping on port websecure for my cloud kubernetes cluster.
here are parts of the traefik deployment yaml config with the ping and ports:

     containers:
      - args:
        - --entryPoints.traefik.address=:9000/tcp
        - --entryPoints.web.address=:8000/tcp
        - --entryPoints.websecure.address=:8443/tcp
        - --providers.kubernetescrd
        - --providers.kubernetesingress
        - --accesslog=true
        - --ping=true
        - --ping.entryPoint=websecure
        image: traefik:2.2.5
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /ping
            port: 8443
            scheme: HTTP
       name: traefik
        ports:
        - containerPort: 9000
          name: traefik
          protocol: TCP
        - containerPort: 8000
          name: web
          protocol: TCP
        - containerPort: 8443
          name: websecure
          protocol: TCP
        readinessProbe:
          failureThreshold: 1
          httpGet:
            path: /ping
            port: 8443
            scheme: HTTP

My service for this traefik is only open to 443.

      ports:
      - port: 443
        name: websecure
        targetPort: "websecure"
        protocol: "TCP"

Looking at the traefik logs, I am getting 404:

GET /ping HTTP/1.1" 404 19 "-" "-" 1238 "-" "-" 0ms

How can I get a 200 return status code? Also, should there be ingress created for /ping??

Thank you

The "livenessProbe" is a config to check Traefik itself, "/ping" is a web address listen by Traefik itself on the web entryPoint, so the port of livenessProbe must set to 8000 as your entryPoint config.

port 8000 is the web which isn't used. We only accept websecure from outside which is 8443 in this pod.
The original configuration for liveiness and readiness before adding the ping.entrypoint is this:


readinessProbe:
          httpGet:
            path: /ping
            port: 9000
          failureThreshold: 1
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2
        livenessProbe:
          httpGet:
            path: /ping
            port: 9000
          failureThreshold: 3
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2

I tried 8000 (ping.entryPoint=web) for liveinessProbe port while leaving the readiness port to 8443 and I get errors. I also tried port 9000 using -ping.entryPoint=traefik
For both if i have different readinessprode and liveiness probe, i get these errors:

10.245.0.1 - - [25/Sep/2020:13:30:44 +0000] "GET /ping HTTP/1.1" - - "-" "-" 9 "-" "-" 0ms
time="2020-09-25T13:30:44Z" level=error msg="close tcp [::]:8000: use of closed network connection" entryPointName=web
time="2020-09-25T13:30:44Z" level=error msg="accept tcp [::]:8000: use of closed network connection" entryPointName=web
time="2020-09-25T13:30:44Z" level=error msg="accept tcp [::]:8443: use of closed network connection" entryPointName=websecure
time="2020-09-25T13:30:44Z" level=error msg="accept tcp [::]:9000: use of closed network connection" entryPointName=traefik
time="2020-09-25T13:30:44Z" level=error msg="close tcp [::]:8443: use of closed network connection" entryPointName=websecure
time="2020-09-25T13:30:44Z" level=error msg="close tcp [::]:9000: use of closed network connection" entryPointName=traefikfik

So i started using the same port for readiness and liveiness trying both 8000 and entrypoint as web, and I still get the 404:

 - - [25/Sep/2020:13:59:05 +0000] "GET /ping HTTP/1.1" 404 19 "-" "-" 106 "-" "-" 0ms
- - [25/Sep/2020:13:59:05 +0000] "GET /ping HTTP/1.1" 404 19 "-" "-" 107 "-" "-" 0ms

note that of course the ping@internal works but i need the /ping working.

[25/Sep/2020:13:41:52 +0000] "GET /ping HTTP/1.1" 200 2 "-" "-" 18 "ping@internal" "-" 0ms

ok i got the tls ping working and it has nothing to do with liveiness or readiness probes

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.