Hi team, @Tej_Singh_Rana - I would like to test check pod to pod connectivity to . . .

Mukund Bhatia:
Hi team, @Tej_Singh_Rana - I would like to test check pod to pod connectivity to test few network policies…I tried using curl and nc command, but none of them seem to be working. Is there any other command to check connectivity?

Deekshith Hadil:
try apt install curl ?

kiliev:
Hi, in this case nc is working fine. You have DNS resolution issue

kiliev:
the error comes from the fact that the service name “payroll-service” could not be resolved by CoreDNS (or whatever is being used @ your env)

kiliev:
try payroll-service.default.svc in case it is in the default NameSpace

kiliev:
or payroll-service.default

kiliev:
The convention is my-svc.my-namespace.svc.cluster-domain.example

kiliev:
and take a look in this link https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/

Mukund Bhatia:
@kiliev @Deekshith Hadil - Thank you both for your response. Specifying the fully qualified domain name worked. @Deekshith Hadil - I tried installing curl using apt install curl, but it threw an error ‘apt not found’… In exam, I assume we can use a nc command to confirm the connectivity after creating a network policy?

kiliev:
kubectl run mytester --rm -it – sh