entryPoint "frontend" doesn't exist

Hi Team,

I am a nube experimenting traefik with EKS. I have the traefik up and running based on the documentation Kubernetes and Let's Encrypt - Traefik

I am able to access:
http://localhost:8000/notls
http://localhost:8080/dashboard

But when I run additional pods, traefik is not able to register the routes. I am not sure what is that I am missing. Attached are the screenshot of error and config file.

Can somebody tell me where exactly to add the "entry points" for the custom app that runs as frontend?

Thanks,
Sam

Frontend-ingress-ingress-route.yaml

apiVersion: traefik.containo.us/v1alpha1
  2 kind: IngressRoute
  3 metadata:
  4   name: frontendingressroute
  5   namespace: default
  6 spec:
  7   entryPoints:
  8     - frontend
  9   routes:
 10   - match: Host(`localhost`) && PathPrefix(`/frontend`)
 11     kind: Rule
 12     services:
 13     - name: frontend
 14       port: 80
 15 


frontend.yaml
  1 apiVersion: apps/v1
  2 kind: Deployment
  3 metadata:
  4   name: frontend
  5   labels:
  6     app: guestbook
  7 spec:
  8   selector:
  9     matchLabels:
 10       app: guestbook
 11       tier: frontend
 12   replicas: 1
 13   template:
 14     metadata:
 15       labels:
 16         app: guestbook
 17         tier: frontend
 18     spec:
 19       containers:
 20       - name: php-redis
 21         image: gcr.io/google-samples/gb-frontend:v4
 22         resources:
 23           requests:
 24             cpu: 100m
 25             memory: 100Mi
 26         env:
 27         - name: GET_HOSTS_FROM
 28           value: dns
 29           # value: env
 30         ports:
 31         - containerPort: 80
 32 ---     
 33 apiVersion: v1
 34 kind: Service
 35 metadata:
 36   name: frontend
 37   labels:
 38     app: guestbook
 39     tier: frontend
 40 spec:
 41   # comment or delete the following line if you want to use a LoadBalancer
 42   type: NodePort
 43   # if your cluster supports it, uncomment the following to automatically create
 44   # an external load-balanced IP for the frontend service.
 45   # type: LoadBalancer
 46   ports:
 47   - port: 80
 48     name: frontend
 49   selector:
 50     app: guestbook
 51     tier: frontend

HI TEAM,

Appreciate if somebody could help me over here.

Hi @audifromgoa and thanks for your interest in Traefik,

The error message says that there are no entrypoints configured with the name frontend. In your screen capture, there are two entrypoints configured:

  • the web entrypoint bound on port 8000
  • the Traefik entrypoint bound on port 8080, used for the API and the Dashboard

Therefore, your IngressRoute resource should look like the following:

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: frontendingressroute
  namespace: default
spec:
  entryPoints:
    - web # <--
  routes:
    - match: Host(`localhost`) && PathPrefix(`/frontend`)
      kind: Rule
      services:
        - name: frontend
          port: 80 

For more details on the entrypoints configuration, check out the following documentation.

Hope this helps!

Hi Kevin,

Thanks for sharing the details. Now I am having the routes set.

But I see the frontend is shown as "loadbalancer" in traefic whereas it is a NodePort service. PFA the screenshot of the output of all kubectl get all and Traefic route screenshot.

Seems like traefic has is holding stale route/data. Thats the reason probably I am not able to reach to localhost:8000/frontend

Can you please review the attached screenshot and get back with your expert comments?

Thanks,
Sam

Regards

Hi again,

Why this service is of type NodePort?
What is the error when you are trying to access localhost:8000/frontend?

Could you share your logs from the beginning and also share the runtime configuration which should be accessible at the following URL http://localhost:8080/api/rawdata?

Even if the service is of type NodePort this should work and as a side note, Traefik always creates a load balancer for any type of Kubernetes services.

Hi Kevin,

Thanks for your attention.

  1. Sole intention is to access the services on /frontend. Please suggest if not Node port what type of service should be in use?
  2. On accessing localhost:8000/frontend I get "The requested URL /frontend was not found on this server."
  3. Logs of http://localhost:8080/api/rawdata? are attached.
{"routers":{"api@internal":{"entryPoints":["traefik"],"service":"api@internal","rule":"PathPrefix(`/api`)","priority":2147483646,"status":"enabled","using":["traefik"]},"dashboard@internal":{"entryPoints":["traefik"],"middlewares":["dashboard_redirect@internal","dashboard_stripprefix@internal"],"service":"dashboard@internal","rule":"PathPrefix(`/`)","priority":2147483645,"status":"enabled","using":["traefik"]},"default-frontendingressroute-46fc27155f838afb28e4@kubernetescrd":{"entryPoints":["web"],"service":"default-frontendingressroute-46fc27155f838afb28e4","rule":"Host(`localhost`) \u0026\u0026 PathPrefix(`/frontend`)","status":"enabled","using":["web"]},"default-simpleingressroute-82f0720c65033c7bec80@kubernetescrd":{"entryPoints":["web"],"service":"default-simpleingressroute-82f0720c65033c7bec80","rule":"Host(`localhost`) \u0026\u0026 PathPrefix(`/notls`)","status":"enabled","using":["web"]}},"middlewares":{"dashboard_redirect@internal":{"redirectRegex":{"regex":"^(http:\\/\\/(\\[[\\w:.]+\\]|[\\w\\._-]+)(:\\d+)?)\\/$","replacement":"${1}/dashboard/","permanent":true},"status":"enabled","usedBy":["dashboard@internal"]},"dashboard_stripprefix@internal":{"stripPrefix":{"prefixes":["/dashboard/","/dashboard"]},"status":"enabled","usedBy":["dashboard@internal"]}},"services":{"api@internal":{"status":"enabled","usedBy":["api@internal"]},"dashboard@internal":{"status":"enabled","usedBy":["dashboard@internal"]},"default-frontendingressroute-46fc27155f838afb28e4@kubernetescrd":{"loadBalancer":{"servers":[{"url":"http://192.168.16.55:80"}],"passHostHeader":true},"status":"enabled","usedBy":["default-frontendingressroute-46fc27155f838afb28e4@kubernetescrd"],"serverStatus":{"http://192.168.16.55:80":"UP"}},"default-simpleingressroute-82f0720c65033c7bec80@kubernetescrd":{"loadBalancer":{"servers":[{"url":"http://192.168.20.81:80"},{"url":"http://192.168.38.38:80"}],"passHostHeader":true},"status":"enabled","usedBy":["default-simpleingressroute-82f0720c65033c7bec80@kubernetescrd"],"serverStatus":{"http://192.168.20.81:80":"UP","http://192.168.38.38:80":"UP"}},"noop@internal":{"status":"enabled"}}}

Thanks.

I have looked at the runtime configuration and everything looks fine.

Sole intention is to access the services on /frontend. Please suggest if not Node port what type of service should be in use?

Using a NodePort service means that Kubernetes will open a port on each Kubernetes node. Therefore, your service will be accessible by sending a request to a Kubernetes node IP with the mapped port. In your case, the port is the 30165. For more details, check out the following documentation.

As you are using Traefik to expose the frontend service, there is no need to use a service of type NodePort. The frontend service will be accessible through the Traefik service.

On accessing localhost:8000/frontend I get "The requested URL /frontend was not found on this server."

This error is returned by your frontend service because the /frontend path does not exist. In order to fix that, you have to use the StripPrefix middleware to remove the /frontend path from the forwarded request as described in the following documentations:

1 Like