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.