2

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

mario
  • 9,858
  • 1
  • 26
  • 42

1 Answers1

1

DryRun has been implemented with version 5.2.0 according to this issue https://github.com/fabric8io/kubernetes-client/issues/2588.

It can be used like this on many resources:

petClient.inNamespace(currentNamespace).withName("dry-run-delete").dryRun().delete();
aemaem
  • 935
  • 10
  • 20