<p>I am trying to use kubernetes-client in java to perform a json-patch which intern triggers a deployment. Sample code is as follows</p>

<pre><code> ExtensionsV1beta1Api api = new ExtensionsV1beta1Api(ClientBuilder.standard().build());
  ExtensionsV1beta1Deployment deploy =
      PatchUtils.patch(
          ExtensionsV1beta1Deployment.class,
          () -&gt;
              api.patchNamespacedDeploymentCall(
                  deploymentName,
                  namespace,
                  new V1Patch(jsonPatchStr),
                  null,
                  null,
                  null,
                  null,
                  null),
          V1Patch.PATCH_FORMAT_JSON_PATCH,
          api.getApiClient());

  log.info("json-patching started for " + deploymentName + " , the deployment is: "
      + deploy);
</code></pre>

<p>The json-patch is working and new pods are created with the required changes. Ideally, I want to wait my thread until all the required pods are created and then move on to my next time, so I wanted some help in finding out how to track the deployment status for the json-patch performed.</p>

<p>Instead of putting the tests on your java client, I would suggest to let k8s to deal with this kind of dependencies by adding <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-startup-probes" rel="nofollow noreferrer">startup probes</a></p>

<p>Basically it will let you deploy all pods in any order but will have a restriction of when the k8s would start the pods on a simple health check of another pod</p>
