Cannot Connect to $(minikube ip):$NODE_PORT on mac M1

Viewed 408

I am learning kubernetes on minikube. I studied the kubernetes official documentation and followed their interactive tutorial in a sandboxed environment. Everything worked fine in the sandbox but I tried the same thing on my system it failed.

My Setup :

  • I am using macOS Big Sur version 11.6.2(20G314) on Apple M1.
  • I have used docker instead of virtual machine environment for minikube.

Steps to reproduce :

First I created a deployment, then I created a NodePort type service to expose it to external traffic.

The pod is running fine and no issues are seen in the service description.

To test if the app is exposed outside of the cluster I used curl to send a request to the node :

curl $(minikube ip):$NODE_PORT

But I get no response from the server :

curl: (7) Failed to connect to 192.168.XX.X port 32048: Operation timed out.

I have copied everything that was done in the tutorial. Same deployment name, same image, same service-name, literally EVERYTHING.

I tried LoadBalancer type, but found out that minikube doesn't support it. To access the LoadBalancer deployment, I used the command minikube tunnel but this did not help.

What could be the possible reasons? Is it my system?

1 Answers

I also had this problem on my m1 mac. I was able to access the service by using this command :

kubectl port-forward svc/kubernetes-bootcamp 8080:8080

You can see this article and this answer for more info and ways to go about it.

Related