<p><a href="https://github.com/kubernetes-sigs/kustomize/blob/master/examples/helloWorld/README.md" rel="nofollow noreferrer">kustomize</a>'s docs provides a nice one-liner that compares two different overlays...</p>

<pre><code>diff \
  &lt;(kustomize build $OVERLAYS/staging) \
  &lt;(kustomize build $OVERLAYS/production)
</code></pre>

<p>is there a way to do the same but against what is running within a specific kubernetes namespace and that of a defined overlay on disk?</p>

<p>more specifically, knowing what an <code>kubectl apply -k .</code> would do without actually doing it? using <code>--dry-run</code> just says spits out a list of the objects rather than a real diff.</p>

<pre><code>kustomize build ./ | kubectl diff -f  -
</code></pre>
<p>In Kustomize version 4.x.x</p>
