Hello I have confused between the two imperatives kubectl run nginx --image=ngin . . .

Mo’een sokkar:
Hello
I have confused between the two imperatives
kubectl run nginx --image=nginx
and
kubectl create deployment --image=nginx nginx

Alexander Nabokikh:
first creates a pod, second creates a deployment

Shashi kumar:
They both will create deployment.

Shashi kumar:
Run using generator and create using imperative way

Deepak Ladwa:
is it mandatory to use the generator option with the latest version of k8s or still we can use run option to create a pod

Rakesh Kumar Parida:
First command will create pod named nginx, second will create deployment named nginx

runlevl4:
Run each command. What happens? Doing well in these exams relies upon understanding, not just memory. Play with the commands. Explore the options. Build that understanding.

Mohamed Ayman:
All kubectl run generators are deprecated in the new version of kubernetes.

Mohamed Ayman:
$ kubectl run nginx --image=nginx
In version 1.18+, it creates a Pod. You don’t have to be confuse. You can verify in the lab.

To create a deployment, please follow the below command:
$ kubectl create deployment nginx --image=nginx --replicas=3
In v1.19, we can now add –replicas flag also.

Tej_Singh_Rana:
Hello, @Deepak Ladwa
No need to specify the generator option in v1.18+.
Simply run the command to create a pod - kubectl run

Deepak Ladwa:
@Tej_Singh_Rana Thanks for the clarification.