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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With