<p>The official <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="noreferrer">kubernetes guidelines</a>, instructs on updating the deployment either by performing a command line <code>set</code>:</p>
<pre><code>kubectl set image deployment/nginx-deployment nginx=nginx:1.9.1
</code></pre>
<p>or by inline editing (that will launch the default editor I guess)</p>
<pre><code>kubectl edit deployment/nginx-deployment
</code></pre>
<p>However both processes make consistency more difficult given that one needs to go and udpate offline the <code>my-deployment.yml</code> file, where the up &amp; running deployment came from. (and this deprives one from the advantage of keeping their manifests version-controlled).</p>
<p>Is there a way to</p>
<ul>
<li>launch a deployment via the file</li>
<li>perform (when needed) updates to the <strong>same</strong> file</li>
<li>update the deployment by pointing to the same, updated file?</li>
</ul>

<p>You can do it simply by following steps - </p>

<ol>
<li>Edit the deployment.yaml file </li>
<li><p>Run below command - </p>

<pre><code>kubectl apply -f deployment.yaml
</code></pre></li>
</ol>

<p>This is what I usually follow. You can use a kubectl patch or edit also. </p>
