<p>I am running Rancher Desktop on my ubuntu laptop.
I have a container running mongodb in a kubernetes container:</p>
<pre><code>$ kubectl get all
NAME                                                 READY   STATUS              RESTARTS       AGE
pod/mongo-deployment-7fb46bd85-vz9th                 1/1     Running             0              37m

NAME                                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)           AGE
service/kubernetes                   ClusterIP   10.43.0.1       &lt;none&gt;        443/TCP           3d17h
service/mongo-service                NodePort    10.43.132.185   &lt;none&gt;        27017:32040/TCP   37m

NAME                                            READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/mongo-deployment                1/1     1            1           37m

NAME                                                       DESIRED   CURRENT   READY   AGE
replicaset.apps/mongo-deployment-7fb46bd85                 1         1         1       37m
</code></pre>
<p><strong>So the node port of the mongo service is: 32040.</strong></p>
<p>I have found the local ip of the kubernetes node:</p>
<pre><code>$ kubectl get node -o wide
NAME                   STATUS   ROLES                  AGE     VERSION        INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
lima-rancher-desktop   Ready    control-plane,master   3d17h   v1.23.6+k3s1   192.168.5.15   &lt;none&gt;        Alpine Linux v3.15   5.15.32-0-virt   containerd://1.5.11
</code></pre>
<p><strong>so the internal  ip is: 192.168.5.15</strong></p>
<p>but when i try to connect to 192.168.5.15 on port 32040 i get <code>connection timed out</code>.</p>
<p>could i have a hint on how to do this  with Rancher Desktop ?</p>
<p>thank you,
Andrei</p>

<p>i found a solution: it seems that the ip returned by
<code>kubectl get node -o wide</code>
is not usable to acess services from the kubernetes node, in Rancher Desktop (it is working in other kubernetes cluster named &quot;kind&quot; (<a href="https://kind.sigs.k8s.io/" rel="nofollow noreferrer">https://kind.sigs.k8s.io/</a>)).</p>
<p>What is working for Rancher Desktop is to access the NodePort service directly on localhost, so in the example above: localhost:32040</p>
