title: Why kubectl run create deplyment sometimes
body: <p>Can I know why kubectl run sometimes create deployment and sometimes pod. </p>
  
  <p>You can see 1st one creates pod and 2nd one creates deployment. only diff is --restart=Never</p>
  
  <pre><code>
  // 1
  chams@master:~/yml$ kubectl run ng --image=ngnix --command --restart=Never --dry-run -o yaml
  apiVersion: v1
  kind: Pod
  ..
  status: {}
  
  //2
  chams@master:~/yml$ kubectl run ng --image=ngnix --command  --dry-run -o yaml
  kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    creationTimestamp: null
    labels:
      run: ng
    name: ng
  ..
  status: {}
  </code></pre>