You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the KubernetesAssistant (or OpenshiftAssistant) we can programmatically wait for a pod to be ready by using the method: awaitApplicationReadinessOrFail
This method use another one called isRunning(Pod pod) to detect if the Pod is running.
However, after multiple manual tests, the check made by the isRunning method is inadequate.
Inadequate in term of the main objective of the method awaitApplicationReadinessOrFail because we want to know if the pod is ready meaning that each containers in the pod are ready.
Next, I've noticed that when the phase return running it does not mean that all containers in pod are ready (ie the readiness probe is ok for each of them).
So, having a pod phase defined to running means that containers have been started with readiness probe currently not check and the pod is in "Not ready" state displayed on the web console. Furthermore after all readiness probes are ok the phase will also return running.
So I propose this implementation instead which will check that all containers in the pod are ready:
Expose a route and use awaitUrl method to wait for the application to be ready.
Regards,
Damien
The text was updated successfully, but these errors were encountered:
dcdh
changed the title
KubernetesAssistant : improve detection of running pod
KubernetesAssistant : improve detection of ready containers in pod
May 10, 2018
Using the KubernetesAssistant (or OpenshiftAssistant) we can programmatically wait for a pod to be ready by using the method: awaitApplicationReadinessOrFail
This method use another one called isRunning(Pod pod) to detect if the Pod is running.
Currently the implementation is:
However, after multiple manual tests, the check made by the isRunning method is inadequate.
Inadequate in term of the main objective of the method awaitApplicationReadinessOrFail because we want to know if the pod is ready meaning that each containers in the pod are ready.
Next, I've noticed that when the phase return running it does not mean that all containers in pod are ready (ie the readiness probe is ok for each of them).
So, having a pod phase defined to running means that containers have been started with readiness probe currently not check and the pod is in "Not ready" state displayed on the web console. Furthermore after all readiness probes are ok the phase will also return running.
So I propose this implementation instead which will check that all containers in the pod are ready:
And I guess that it should be a good point to rename the method isRunning to isReady or areAllContainersReady or something else.
Eratum
I confirm this code works :)
So this is working:
Workaround:
Expose a route and use awaitUrl method to wait for the application to be ready.
Regards,
Damien
The text was updated successfully, but these errors were encountered: