DCA · Question #75
One of several containers in a pod is marked as unhealthy after failing its livenessProbe many times. Is this the action taken by the orchestrator to fix the unhealthy container? Solution: The…
The correct answer is B. No. The orchestrator's action after a liveness probe failure depends on the pod's restart policy; if set to 'Never', the container will not be restarted.
Question
One of several containers in a pod is marked as unhealthy after failing its livenessProbe many times. Is this the action taken by the orchestrator to fix the unhealthy container? Solution: The unhealthy container is restarted.
Options
- AYes
- BNo
How the community answered
(22 responses)- A23% (5)
- B77% (17)
Why each option
The orchestrator's action after a liveness probe failure depends on the pod's restart policy; if set to 'Never', the container will not be restarted.
Restarting the unhealthy container is the default behavior for most workload types, but the `restartPolicy: Never` configuration would prevent such a restart from occurring.
While often the default, a container being restarted after a liveness probe failure is not a universal action, as it depends on the pod's `restartPolicy`. If the `restartPolicy` is explicitly set to `Never`, the container will be terminated by the kubelet but will not be restarted.
Concept tested: Kubernetes liveness probe and restart policy
Source: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
Topics
Community Discussion
No community discussion yet for this question.