<p>I'm new to k8s and I'm trying to learn how to setup deployments. </p>

<p>I'm searching for a way to create a new deployment without any images. Over time, I will add new (0 or more) images (and specify thier desired state). As I don't know what images the deployment will contain in advance, I can't use any existing configuration files.</p>

<p>Is it possible? If yes, how? </p>

<ul>
<li>If it's possible, a command-line solution will be great.</li>
</ul>

Stav Alfi
<p>If you want to start a single instance of nginx, you can do</p>

<pre><code> $  kubectl run nginx --image=nginx
</code></pre>

<p>But it is not possible to create any deployments without image. </p>

<pre><code>$ kubectl run demo  --image=""
error: --image is required
</code></pre>

<p>If you want to edit your existing deployment, then you can run</p>

<pre><code>$ kubectl edit deployments &lt;deployment-name&gt; -n &lt;namespace&gt;

</code></pre>

<p>You can also patch container with new image to existing deployments by running following command</p>

<pre><code>$ kubectl patch deployment &lt;deployment-name&gt; -p   '{"spec":{"template":{"spec":{"containers":[{"name":"myapp","image":"newimage"}]}}}}'
</code></pre>

<p>To replace image of a containers in deployment, run</p>

<pre><code>$ kubectl set image deployment/&lt;deployment-name&gt; &lt;container-name&gt;=&lt;image&gt;
</code></pre>
