This command from Mock-2 does not work $ kubectl run test-dns --image=busybox:1. . . .

ajay jha:
This command from Mock-2 does not work
$ kubectl run test-dns --image=busybox:1.28 --rm -it – nslookup nginx-resolver-service

Tej_Singh_Rana:
Hello, @ajay jha
You have to add --restart=Never flag.

ajay jha:
controlplane $ kubectl run test-dns --image=busybox:1.28 --restart=never --rm -it – nslookup nginx-resolver-service
error: invalid restart policy: never
See ‘kubectl run -h’ for help and examples
controlplane $

Narendra Singh:
@ajay jha never is not equal to Never

Narendra Singh:

--restart='Always': The restart policy for this Pod.  Legal values [Always, OnFailure, Never].

controlplane $ kubectl run dummy --image=busybox:1.28 --rm -it --restart=Never – nslookup nginx-resolver-service
Server: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name: nginx-resolver-service
Address 1: 10.103.223.162 nginx-resolver-service.default.svc.cluster.local
pod “dummy” deleted