Rahul:
root@controlplane:~# k run busybox6 --image=busybox -it – /bin/sh -c ‘echo Hello World’
error: timed out waiting for the condition
root@controlplane:~# kubectl run busybox4 --image=busybox -it --restart=Never – /bin/sh -c ‘echo hello world’
hello world
2nd statement works whereas 1st does not. Can anyone help here
Tej_Singh_Rana:
Hello, @Rahul
Because -it
works with --restart=Never
Rahul:
@Tej_Singh_Rana So if we want to have a temporary pod to run this command ?
Poorni:
Use --rm. kubectl run busybox4 --image=busybox -it --restart=Never --rm -i – /bin/sh -c ‘echo hello world’
Tej_Singh_Rana:
Yeah, you’re correct @Rahul , to make a temporary pod add --rm
flag also as Poorni suggested.