Ingress always goes to 404

I was trying to add an Ingress controler to my K8s cluster by following this guide setup nginx

I did everything until the DNS record point and it always redirects me to 404 not found. I check everything I could check so I really need help please.

kind: Ingress
  name: yeebus-ingress
    - host:
          - path: "/"
            pathType: Prefix
                name: auth-api-service
                  number: 80
    - host:
          - path: "/"
            pathType: Prefix
                name: email-api-service
                  number: 80

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello thanks for the reply. Changing the host didn’t help but I tried what you recommended and found few interesting things.

apiVersion: apps/v1
kind: Deployment
  name: email-api-deployment
    app: email-api
    type: RollingUpdate
      maxSurge: 25%
      maxUnavailable: 25%
  replicas: 2
      app: email-api
        app: email-api

This is what my email deployment looks like and the label should be email-api but when I tried

kubectl get pods -l email-api

I have that error message : No resources found in default namespace.

Same when I try to show ingress logs : No resources found in ingress-nginx namespace.

But when I used the describe action. / auth-api-service:80 / email-api-service:80

And I checked the backends IP addresses were the correct one

This comment has been deleted

    Bobby Iliev
    Site Moderator
    Site Moderator badge
    October 19, 2023

    Hi there,

    Did removing the duplicated host help with the 404 errors? And did you apply the changes after you updated the yaml file?

    If you are still seeing the issue, a few things that you could check would be:

    1. Check the status of the services to which the Ingress is routing:

      kubectl get svc auth-api-service email-api-service

      Make sure that the services have the correct pods selected and are receiving traffic correctly.

    2. Make sure the services have the correct endpoints associated:

      kubectl describe svc auth-api-service email-api-service
    3. Check if the pods for your services are running and healthy:

      kubectl get pods -l <your-label-selector>
    4. Check the logs of the Nginx Ingress controller to see if there are any issues or helpful messages:

      kubectl logs -l app=nginx-ingress -n <nginx-ingress-namespace>
    5. Check that the Ingress Controller itself is running without issues. If using Helm:

      helm list -n <namespace-of-ingress-controller>
    6. Describe the Ingress resource to see if there are any annotations or statuses that might give a clue:

      kubectl describe ingress yeebus-ingress

    Let me know how it goes!



    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Featured on Community

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel