<p>One of the points in the <code>kubectl</code> <a href="https://kubernetes.io/docs/reference/kubectl/conventions/#best-practices" rel="nofollow noreferrer">best practices section in Kubernetes Docs</a> state below:</p>

<blockquote>
  <p>Pin to a specific generator version, such as <code>kubectl run
  --generator=deployment/v1beta1</code></p>
</blockquote>

<p>But then a little down in the doc, we get to learn that except for Pod, the use of <code>--generator</code> option is deprecated and that it would be removed in future versions.</p>

<p>Why is this being done? Doesn't generator make life easier in creating a template file for resource definition of deployment, service, and other resources? What alternative is the kubernetes team suggesting? This isn't there in the docs :(</p>

karthiks
<p>For deployment you can try</p>

<pre><code>kubectl create deployment hello-node --image=gcr.io/hello-minikube-zero-install/hello-node
</code></pre>

<p>and </p>

<p><strong>Note</strong>: <code>kubectl run --generator except for run-pod/v1</code> is deprecated in v1.12.</p>
