<p>I'm looking for a way to export a yaml file from a deployed component but without the cluster specific information. </p>

<pre><code>kubectl get MYOBJECT --export -o yaml &gt; my.yaml
</code></pre>

<p>but since "export" is now deprecated (since 1.14 and should normally disappear in 1.18 (didn't find it in changelog), what would be an alternative ?</p>

<p>thanks</p>

<p>Using JQ does the trick.</p>
<pre><code>kubectl get secret &lt;secretname&gt; -ojson | jq 'del(.metadata.namespace,.metadata.resourceVersion,.metadata.uid) | .metadata.creationTimestamp=null'
</code></pre>
<p>produces exactly the same JSON as</p>
<pre><code>kubectl get secret &lt;secretname&gt; -ojson --export
</code></pre>
