<p>Goal: Create a generic manifest for an existing deployment and strip the cluster distinct details.  Deploy this manifest on a different cluster.</p>

<p>Progress:</p>

<p><code>kubectl get deployment &lt;DEPLOYMENT_NAME&gt; -n &lt;NAMESPACE&gt; -o yaml</code></p>

<p>Generates a deployment file but it has all sorts of info that is distinct to this cluster / instantiation and must be stripped.  For example:</p>

<p><code>lastTransitionTime: 2019-03-20T23:38:42Z</code></p>

<p><code>lastUpdateTime: 2019-03-20T23:39:13Z</code></p>

<p><code>uid: 53444c69-acac-11e8-b870-0af323746f0a</code></p>

<p><code>resourceVersion: "97102711"</code></p>

<p><code>creationTimestamp: 2018-08-30T23:27:56Z</code></p>

<p>... just to name a few.  </p>

<p>Is there an option to remove these fields in return or an easy way to only pull the minimum definitions to replicate the object in another cluster?</p>

<p>As suggested by @Matthew L Daniel <code>kubectl get deployment &lt;DEPLOYMENT_NAME&gt; -n &lt;NAMESPACE&gt; -o yaml --export=true</code> will do the work.</p>

<p>You can also find useful kubectl tricks <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">here</a> and <a href="https://github.com/dennyzhang/cheatsheet-kubernetes-A4" rel="nofollow noreferrer">here</a>. Additionality full kubectl reference can be found <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands" rel="nofollow noreferrer">here</a>.</p>
