minikube: Ingress not working on Mac M1 host machine

What Happened?

I have ingress addon enable in my minikube cluster. I add my host names to /etc/hosts, e.g. myapp.local. The following command just hangs instead of responding as expected

curl myapp.local

I think this might be related to this issue where minikube tunnel hangs (as it does for me as well - usually I don’t need to use tunneling with ingress addon though)

Attach the log file

Let me know which kind of logs is helpful

Operating System

macOS (Default)

Driver

Docker

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 19 (3 by maintainers)

Most upvoted comments

Hi, I can confirm that running minikube tunnel works for me on m1 with the docker driver. Keep in mind that your etc/hosts file needs to map to 127.0.0.1, instead of the output of minikube ip or kubectl get ingress - this is an important gotcha.

Dropping by to let you know what worked for us:

  • enabling the Ingress addon for minikube minikube addons enable ingress
  • minikube tunnel was needed. Do this in another terminal since it needs to be up. You should see logs indicating that the tunnel is working for your exposed service
  • Though it only worked with LoadBalancer services. Using either NodePort or the default service type, would not do the trick. I think for most use cases when runnning locally, the service type should not really matter.
  • Mapping our domain to 127.0.0.1 instead of the output of minikube ip

With these, we were able to access our cluster from outside using Ingress!

The steps outlined here by several people do indeed work. However there is an important limitation moving away from hyperkit and toward the docker driver. hyperkit essentially allowed multiple ingress controllers to be running within minikube and exposed as distinct IP addresses by minikube tunnel. However, on docker this is not possible since it runs on localhost address space.

I’d like to see support for hyperkit or another driver that allows routes into the container IP space.

Hello everyone,

I would like to reopen this issue or get any information you may have about how to solve it @klaases.

I am currently taking an intro course to Kubernetes; I am experienced developer, proficient with Docker, but new to Kubernetes.

I have a namespace.yaml and an app.yaml file. I am able to start my minikube cluster and deploy my pod without any trouble.

I am trying to access my app through 3 different ways:

  • By creating a Kubectl-portward tunnel: using the command kubectl port-forward service/ingress-nginx-controller -n ingress-nginx 8080:80; this works great!
  • By creating a tunnel with minikube tunnel: using minikube tunnel and then retrieving IP address of the Ingress with kubectl get ingress podinfo; this does not work.
  • By directly accessing the cluster IP address: using minikube ip; this does not work either, and returns the same ip address as the one exposed in the previous step.

To summarize, I am able to connect to my app deployed in the cluster by making use of port forwarding, but not by using the minikube tunnel command, which seems like a hurdle in one’s path to learning Kubernetes.

I also tried the steps described by @germanflighel, but it did not solve my issue unfortunately.

Any advice or solution 🙏 ?

Thank you very much, I will remain available if needed.

minikube tunnel is required for ingress to work on the docker/podman drivers, and that’s currently the only driver supported on M1 (VM drivers are in the works). Right now, minikube tunnel will hang when run in another terminal, but that does not mean it’s not working, we just don’t output anything.