Home > Enterprise >  Kubernetes is not assigning address to ingress
Kubernetes is not assigning address to ingress

Time:10-13

I am a beginner with k8s and I followed the k8s official docs to create a hello-world ingress, but I can't make it work. First I create a service and just like the tutorial I get:

$ kubectl get service web 

NAME   TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
web    NodePort   10.100.208.38   <none>        8080:31921/TCP   19m

so, I can access my service via browser:

$ minikube service web

Hello, world!
Version: 1.0.0
Hostname: web-79d88c97d6-xrshs 

So far so good. However, I get stuck in the ingress part. So I create this ingress like the tutorial:

$ kubectl describe ingress example-ingress

Name:             example-ingress
Namespace:        default
Address:          
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend"  not found>)
Rules:
Host              Path  Backends
----              ----  --------
hello-world.info  
                /   web:8080 (172.17.0.4:8080)
Annotations:        nginx.ingress.kubernetes.io/rewrite-target: /$1
...

and even after configuring /etc/hosts with my minikube ip: 192.168.99.102 hello-world.info, when I curl it or access by the browser I get nginx 404. It's strange that my ingress does not get an address, even after a while. Can anyone point me where the error is ?

PS. I did my research before asking here. I check that my minikube ingress addon is enabled and my ingress-nginx-controller pod is running.

PS2. My minikube version is 1.23 and my kubectl client and server versions are 1.22.1.

CodePudding user response:

Seems there is a bug with the Ingress Addon with Minikube 1.23.0, as documented here, which matches the issue you are seeing. ConfigMap issues prevent IngressClass from being generated (usually "nginx" by default) and ingress services won't work.

This issue was fixed in 1.23.1, so updating Minikube should fix your issue.

  • Related