Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the IP address from "docker-for-desktop" node?

I'm trying to get the IP address of the "docker-for-desktop" node.

I'm switching from minikube to docker-for-desktop because it doesn't require VirtualBox.

Screenshot of docker-for-desktop

I created a service that exposes a NodePort. When I use minikube context, I'm able to reach the service via minikube's IP address. When I switch to docker-for-desktop context, I'm not able to reach the service because I don't know its IP address.

With minikube, I was able to do:

$ minikube ip

or even:

$ minikube service list

I'm not sure how to do that with docker-for-desktop.

I would expect to have a command that gives a docker-for-desktop IP address.

like image 568
mathieux51 Avatar asked Jun 12 '19 06:06

mathieux51


People also ask

How do I find my Kubernetes cluster IP?

To find the cluster IP address of a Kubernetes pod, use the kubectl get pod command on your local machine, with the option -o wide . This option will list more information, including the node the pod resides on, and the pod's cluster IP. The IP column will contain the internal cluster IP address for each pod.

How do I get the IP for Minikube cluster?

You can find minikube VM's IP by running minikube IP and then curl %GIVEN_IP:NodePort . You should get a response from your app. 2 - targetPort indicates the service with which port connection should be established.


1 Answers

Minikube is creating a virtual machine that has its own IP, but when using Docker for Mac, you use your own laptop, so where you were using the minikube ip you can now just use localhost. It's just simpler.

like image 136
Jose Armesto Avatar answered Oct 18 '22 13:10

Jose Armesto