May 30, 2021 · Run this code either via your IDE or your build tool (maven in my case): ~ : $ mvn exec:java -Dexec.mainClass="io.fabric8.DeploymentAndServiceCreate". You’ll be able to see pods being created after you run this sample: ~ : $ kubectl get deploy. NAME READY UP-TO-DATE AVAILABLE AGE. hello-dep 2/2 2 2 7m34s.
How to perform rollout restarts like kubectl for Deployments, DaemonSets, and StatefulSets from Java using YAKC. In this post, I'll show you how to perform the equivalent to kubectl rollout restart deployment/$deployment (rolling restart) from Java using YAKC- Yet Another Kubernetes Client.