<p>The <a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/#creating-a-service-for-an-application-running-in-five-pods" rel="nofollow noreferrer">kubernetes doc</a> has a deprecated <code>kubectl run</code> command that I'm looking forward to run using <code>kubectl create deployment</code> command with <code>--template</code> option without using external json/yaml file. I'd appreciate your help in this.</p>

<p>The deprecated command that I'm looking  forward to translate is below:
<code>kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0  --port=8080</code></p>

<p>Simply put, how do i re-write the above <code>kubectl run</code> command with <code>kubectl create deployment</code> command using <code>--template</code> option?</p>

karthiks
<p>You can use <code>run-pod/v1</code> generator in <code>kubectl run</code> command as it is not deprecated for Pod resource instead of <code>deployment/apps.v1</code> for deployments, find more information about Kubernetes API generators <a href="https://kubernetes.io/docs/reference/kubectl/conventions/#generators" rel="nofollow noreferrer">here</a>.</p>

<pre><code>kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0  --port=8080 --generator=run-pod/v1
</code></pre>
