skip to Main Content

I did a helm install of Nginx like this

helm install ingress-nginx ingress-nginx/ingress-nginx 
--namespace ingress-nginx 
--create-namespace 
--version 4.2.0 
--set controller.ingressClass=nginx 
--set rbac.create=true 
--values /tmp/ingress-nginx.yaml

everythng got deployed fine

[rke@k8gui apps]$ kubectl get all -n ingress-nginx
NAME                                 READY   STATUS    RESTARTS   AGE
pod/ingress-nginx-controller-248rc   1/1     Running   0          3m15s
pod/ingress-nginx-controller-hpv8h   1/1     Running   0          3m15s
pod/ingress-nginx-controller-jwzjn   1/1     Running   0          3m15s

NAME                                         TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                      AGE
service/ingress-nginx-controller             LoadBalancer   10.43.117.177   192.168.33.100   80:31678/TCP,443:32340/TCP   3m4s
service/ingress-nginx-controller-admission   ClusterIP      10.43.119.134   <none>           443/TCP                      3m4s

NAME                                      DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR            AGE
daemonset.apps/ingress-nginx-controller   3         3         3       3            3           kubernetes.io/os=linux   3m4s
[rke@k8gui apps]$ curl http://192.168.33.100
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

but curling on the loadbalancer ext ip show 404 not found

any idea?

2

Answers


  1. Seems you are trying to reach external IP from within your cluster.

    Could be this is not possible.

    Can you try from browser?
    Within cluster you could try to reach your cluster IP 10.43.117.177.

    Login or Signup to reply.
  2. You are getting the 404 due to you have maybe not deployed any ingress.

    The output you have pasted above is the ingress controller which is a Nginx controller with external IP. The ingress controller manages the ingress or in other words, routing rules.

    If you have not created any ingress rules to divert traffic into a cluster or if rules are not matching Nginx will throw the 404 error.

    You are getting the 404 itself from Nginx so when you are hitting the External IP of Controller your request reaches till Nginx but no rule matches.

    as you see in output

    <hr><center>nginx</center>
    

    Try creating one hello app deployment and rule of ingress routing as shown in example : https://kubernetes.io/docs/tasks/access-application-cluster/ingress-minikube/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search