title: Kubernetes rolling deployment using the yaml file
body: <p>I have deployed an application into Kubernetes using the following command.</p>
  <pre><code>kubectl apply -f deployment.yaml -n &lt;NAMESPACE&gt;
  </code></pre>
  <p>I have my deployment content in the deployment yaml file.</p>
  <p>This is working fine. Now, I have updated few things in the deployment.yaml file and hence would like to update the deployment.</p>
  <p><strong>Option 1:- Delete and deploy again</strong></p>
  <pre><code>kubectl delete -f deployment.yaml -n &lt;NAMESPACE&gt;
  kubectl apply -f deployment.yaml -n &lt;NAMESPACE&gt;
  </code></pre>
  <p><strong>Option 2:- Use set to update changes</strong></p>
  <pre><code>kubectl set image deployment/nginx-deployment nginx=nginx:1.91
  </code></pre>
  <p>I don't want to use this approach as I am keeping my deployment.yaml file in GitHUB.</p>
  <p><strong>Option 3:- Using edit command</strong></p>
  <pre><code>kubectl edit deployment/nginx-deployment
  </code></pre>
  <p>I don't want to use the above 3 options.</p>
  <p>Is there any way to update the deployment using the file itself.</p>
  <p>Like,</p>
  <pre><code>kubectl update deployment.yaml -n NAMESPACE
  </code></pre>
  <p>This way, I will make sure that I will always have the latest deployment file in my GitHub repo.</p>