Can you explain me the meaning/usage of "--generator=run-pod/v1" (2020-04-28 20:59:46)

Anshuul Sharma
Can you explain me the meaning/usage of “–generator=run-pod/v1”

Anshuul Sharma
Hi, I am new to the course,
I am creating Pod with kubernetes command
kubectl run redis --image=redis123 --generator=run-pod/v1
Can someone explain me the meaning/usage of “–generator=run-pod/v1”

Rahul Soni
<@U012ETETF61> welcome, its is way of telling to kube api that we want to create a pod. if you dont mention it will create a deployment.

Anshuul Sharma
Ohh okay, thanks. So if i dont add that, later I need to run “kubectl create pod” right??

Bernardo Estevao
Not really. A deployment will ultimately create the pods specified in said deployment. You will learn about it in the course, but if you’d like to know more, read about in the|documentation

Anshuul Sharma
Sure, Thanks


For me to create a pod I use --restart option :

kubectl run mypod --image=nginx --restart=Never ==>  for Pod
kubectl run mydep --image=nginx                 ==>  for Deployment