<p>How to find, that which yaml file was used for the deployment of any kubernetes resource.</p>

<p>I checked "kubectl describe", it doesn't list the same, is there anyway to know.</p>

<p>use case:</p>

<p>I want to update the yaml and redeploy, one option, I guess is to generate the yaml from running resource, update and redeploy.</p>

<p>any suggestions ?</p>

sandejai
<p>To get yaml for your k8s application deployment.</p>

<p>Use <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-finding-resources" rel="noreferrer">this</a></p>

<pre><code>kubectl get deploy my-deployment -o yaml --export
 OR
kubectl get pod my-pod -o yaml --export
 OR
kubectl get svc my-svc -o yaml --export
</code></pre>

<p>Editing is also simple.</p>

<pre><code>kubectl get deploy my-deployment -o yaml --export &gt; my-deployment.yml
&lt;Edit the my-deployment.yml file and kubectl apply -f my-deployment.yml&gt;

OR 

kubectl edit deployment my-deployment
</code></pre>

<p>Hope this helps.</p>
