404 not found error in kubernetes

Vinayak Patil 0 Reputation points
2024-04-16T10:34:32.71+00:00

While accessing the url i am getting 404 not found error please help me on this.

apiVersion: networking.k8s.io/v1

kind: Ingress

metadata:

  name: athena-microservices-to-mckup-ingress

  namespace: support-personalization-np

  annotations:

    kubernetes.io/ingress.allow-http: 'false'

    kubernetes.io/ingress.class: nginx

    ncp/http-redirect: 'true'

    ncp/use-regex: 'true'

    nginx.ingress.kubernetes.io/proxy-body-size: '0'

spec:

  rules:

    - host: athena-microservices-to-mckup.prdlvgpu1.aiaccel.dell.com

      http:

        paths:

          - path: /graphql

            pathType: Prefix

            backend:

              service:

                name: athena-microservices-to-mckup-service

                port:

                  number: 5001

  tls:

    - hosts:

      - athena-microservices-to-mckup.prdlvgpu1.aiaccel.dell.com

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,867 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 24,206 Reputation points Microsoft Employee
    2024-04-16T14:12:26.0933333+00:00

    Hello Vinayak Patil

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Based on the details provided, looks like you have created an Ingress resource to expose your service over HTTPS. However, you are getting a 404 not found error while accessing the URL.

    Just check the logs of the Ingress controller to see if there are any errors.
    Ref: https://techcommunity.microsoft.com/t5/fasttrack-for-azure/kubernetes-nginx-ingress-controller-logs/ba-p/3684217

    Please try these troubleshooting steps and see if these help:

    -Make sure that your service is running and accessible within the cluster. You can check this by running the following command:

    kubectl get svc -n support-personalization-np

    This will list all the services in the support-personalization-np namespace. Make sure that the athena-microservices-to-mckup-service service is running and has a valid IP address.

    -Check if the Ingress resource is created successfully by running the following command:

    kubectl get ingress -n support-personalization-np

    -Check if the DNS record for athena-microservices-to-mckup.prdlvgpu1.aiaccel.dell.com is pointing to the IP address of the Application Gateway. You can check this by running the following command:

    nslookup athena-microservices-to-mckup.prdlvgpu1.aiaccel.dell.com

    -Check if the path /graphql is correct and accessible. You can test this by running the following command:

    curl -k https://athena-microservices-to-mckup.prdlvgpu1.aiaccel.dell.com/graphql

    Hope this helps.