Skip to content

Commit

Permalink
Kubernetes: wait for proxy.container-wait-time before pod is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Nov 9, 2020
1 parent 1a64723 commit 8ba1258
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ protected Container startContainer(ContainerSpec spec, Proxy proxy) throws Excep

Pod startedPod = kubeClient.pods().inNamespace(effectiveKubeNamespace).create(patchedPod);

// Workaround: waitUntilReady appears to be buggy.
Retrying.retry(i -> Readiness.isReady(kubeClient.resource(startedPod).fromServer().get()), 60, 1000);
int totalWaitMs = Integer.parseInt(environment.getProperty("proxy.container-wait-time", "20000"));
Retrying.retry(i -> Readiness.isReady(kubeClient.resource(startedPod).fromServer().get()), totalWaitMs / 1000, 1000);
if (!Readiness.isReady(kubeClient.resource(startedPod).fromServer().get())) {
throw new ContainerProxyException("Container did not become ready in time");
}
Pod pod = kubeClient.resource(startedPod).fromServer().get();

Service service = null;
Expand Down

0 comments on commit 8ba1258

Please sign in to comment.