skip to content
Alvin Lucillo

A handy command to check k8s svc

/ 1 min read

💻 Tech

A handy command I used today in testing whether we can connect to a service is:

nc -zv -w 5 svc-name:80

This command checks whether we can connect to the service on port 80. The -z flag means that nc will not send any data (i.e., used for scanning and not sending/receiving data). The -v flag means that nc will show more information to understand better what’s happening. The -w 5 flag means that nc will wait for 5 seconds before timing out to limit the waiting time.