Hi Again While testing `nslookup` from test pod , sometimes getting output and . . .

surapureddy ajay:
Hi Again
While testing nslookup from test pod , sometimes getting output and sometimes getting timeout error.

controlplane $ kubectl run test --image busybox:1.28 --rm -it -- nslookup 10-244-1-7.default.pod 
If you don't see a command prompt, try pressing enter.
Error attaching, falling back to logs: 
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      10-244-1-7.default.pod
Address 1: 10.244.1.7 10-244-1-7.nginx-resolver-service.default.svc.cluster.local
pod "test" deleted


controlplane $ kubectl run test --image busybox:1.28 --rm -it -- nslookup 10-244-1-7.default.pod > /root/CKA/nginx.pod
error: timed out waiting for the condition
controlplane $

May I know what is the reason. Is this something with bandwidth or pod issue?

Raamkanna Saranathan:
see output below… i did a quick test. busybox exists immediately after the container is created. so keep it running for some time. add a --command sleep 5000 to the kubectl command and you should be good.

raam@Raamkannas-MBP CKA % kubectl run test --image busybox:1.28
pod/test created
raam@Raamkannas-MBP CKA % kubectl get po
NAME                                 READY   STATUS              RESTARTS   AGE
test                                 0/1     Completed           1          12s

surapureddy ajay:
Thanks