<p>In <strong>command line</strong> we can use <code>kubectl apply --server-dry-run -f example-pod.yml</code> to make a trial run of <code>yml</code> file without persisting it. 
Can we do smth similar from <strong>Java</strong>, using <code>io.fabric8.kubernetes</code> (Java client for kubernetes) ?</p>

<p>DryRun has been implemented with version <code>5.2.0</code> according to this issue <a href="https://github.com/fabric8io/kubernetes-client/issues/2588" rel="nofollow noreferrer">https://github.com/fabric8io/kubernetes-client/issues/2588</a>.</p>
<p>It can be used like this on many resources:</p>
<pre class="lang-java prettyprint-override"><code>petClient.inNamespace(currentNamespace).withName(&quot;dry-run-delete&quot;).dryRun().delete();
</code></pre>
