<p>In a kubernetes cluster we can create a workload and expose it in two separate commands.</p>
<ol>
<li>kubectl run deployment-name --image=imagename</li>
<li>kubectl expose deployment deployment-name [--port=port --type=type --name=name]</li>
</ol>
<p>Could we do it in one command?</p>

Aditya Bhuyan
<p>This could be achieved by the below command. It will create a workload and also expose it in same time.</p>
<p><strong>kubectl run nginx-digital --image=nginx --expose=true --port=80</strong></p>
<p>The above command will create a deployment <em>nginx-digital</em> and also expose it with <em>ClusterIP</em> service with name <em>nginx-digital</em> at port <em>80</em>.</p>
