-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pod health should be checking for readiness #1650
Conversation
Signed-off-by: Alena Varkockova <varkockova.a@gmail.com>
lgtm, although you need to add a PodRunningCondition in |
@ANeumann82 thanks, you're the best :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, lgtm 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it 🚢
@@ -106,7 +108,7 @@ func IsHealthy(obj runtime.Object) error { | |||
return fmt.Errorf("instance %s/%s active plan is in state %v", obj.Namespace, obj.Name, obj.Spec.PlanExecution.Status) | |||
|
|||
case *corev1.Pod: | |||
if obj.Status.Phase == corev1.PodRunning { | |||
if obj.Status.Phase == corev1.PodRunning && podutils.IsPodReady(obj) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need both conditions to be true? Isn't podutils.IsPodReady(obj)
enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not have that in the first version but in the end I ended up doing exactly what StatefulSet is doing to be on the safe side https://github.com/kubernetes/kubernetes/blob/60044a8accfe8fddeb452c4adca4fefbbff64967/pkg/controller/statefulset/stateful_set_utils.go#L204
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com> # Conflicts: # pkg/engine/health/health.go
Signed-off-by: Alena Varkockova varkockova.a@gmail.com
What this PR does / why we need it:
We already use ready condition when evaluating health of statefulset we should do it for pods as well. Running condition is not enough as the container might be just starting also it does not include waiting for the readiness checks.
See https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ for more context. Also see how StatefulSet evaluates what goes into
readyReplicas
https://github.com/kubernetes/kubernetes/blob/60044a8accfe8fddeb452c4adca4fefbbff64967/pkg/controller/statefulset/stateful_set_utils.go#L204Fixes #