How to access to service port in Kubernetes cluster with kind

Hello,
I deploy a multi-node cluster with latest Docker-Desktop in Windows 10 with kind, four node, 1 control-plane and 3 workers nodes.

So nodes have 172.18.0.x ip and now I don’t see how to access service in k8s for example a nodeport service :

$ kubectl.exe get svc
NAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
kubernetes   ClusterIP   10.96.0.1      <none>        443/TCP        15d
nginx        NodePort    10.96.255.75   <none>        80:30000/TCP   31m

I could not access to port 30000.

How can I do that ?

Thanks

I think it was the same before Kind, but you can create a LoadBalancer service which is automatically handled by Docker Desktop’s own cloud controller. When you use kind, I guess it is “kind-cloud-provider”, but it looks like it is not part of the cluster just running as another container next to the node containers.

So if you create a LoadBalancer service on port 30000, it will be published on localhost and you can use “localhost:30000” in your browser. If you need multiple services, you can install an ingress controller which by default has a LoadBalancer service and you can use it as a proxy to access any service in the multi-node cluster through the ingress port and using domains or paths.

@rimelek It seems that the network for node in kind 172.18.0.0 is not accessible from Windows, If a create a load balancer service it create external-ip on this network :

vote-service-lb LoadBalancer 10.96.102.74 172.18.0.8 8080:30551/TCP 5m7s

But I couldn’t ping this IP.

Please, share a config that can be used to reproduce your issue. The loadbalancer mode automatically makes your service available from your host machine using “localhost”, not the IP of a container. Routing to the actual service will be solved by Docker Desktop. There was an older blogpost about this too.

It seems I deleted my previous test service and I can’t create a new one right now, but I tested it before I wrote my previous answer and I used kind.

@rimelek ok I undestand :wink:

With LoadBalancer Service port is exposed on localhost not on node IP so I can see my app in navigator !

Thanks for you’re help