<p>Okay first let me say please don't judge. Believe me, I am kicking myself in the ass.</p>
<p>So I lost my hard disk on my laptop which held the Kubernetes yaml files that I ran against a Kubernetes Cloud cluster. I don't have the latest backup which is the problem.</p>
<p>does anyone know how to get just the yaml I ran against the K8s cloud server. I can get to the cluster and run <code>kubectl get pod my-pod -o yaml</code> but of course, it adds a lot of things. I am just looking for the yaml that I ran.</p>
<p>I am stressing here and have learned my lesson. Backup, Backup and verify Backup.</p>

user3008410
<p>You can use this and extend it to your needs:</p>
<pre><code>kubectl get [resource type] -n [namespace] [resource Name] -o yaml &gt; [output.yaml]
</code></pre>
<p>The <code>-o yaml</code> will do the job</p>
<h2><a href="https://i.stack.imgur.com/Nq38D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nq38D.png" alt="enter image description here" /></a></h2>
<h3>Note</h3>
<p>You will get some extra information provided by your cloud providers like history, version, and more.</p>
<hr />
<h3>Lens</h3>
<p><a href="https://k8slens.dev/" rel="nofollow noreferrer">https://k8slens.dev/</a></p>
<p>You can use Lens which will allow you to view &amp; edit your resources so you will be able to copy the YAML from it.<a href="https://i.stack.imgur.com/UtaQQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UtaQQ.png" alt="enter image description here" /></a></p>
