I have created a pod called mypod in alpha namespace with nginx image. And anot . . .

sri aishwarya:
I have created a pod called mypod in alpha namespace with nginx image. And another pod called test with busybox image in default namespace. then I used the command k exec test – nslookup ipaddressofmypod. But this is not working. Do I need to expose mypod as a service for nslookup command to work? the command is working if I expose the pod as a service.

praveen bhat:
Yes u need to expose the pod internally, use clusterip

praveen bhat:
Then run this:
Kubectl run test-nslookup --image=busybox:1.28 --restart=Never --rm -it – nslookup <service-name>

Nada Nour:
since the pod is in a different namespace you need to include the namespace
e.g. nslookup 10-x-x-x.alpha.pod