DCA · Question #74
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: Kubernetes
The correct answer is B. No. Kubernetes automatically restarts an unhealthy container detected by a failed liveness probe, rather than executing a user-defined script to fix it.
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: Kubernetes automatically triggers a user-defined script to attempt to fix the unhealthy container.
Options
- AYes
- BNo
How the community answered
(31 responses)- A10% (3)
- B90% (28)
Why each option
Kubernetes automatically restarts an unhealthy container detected by a failed liveness probe, rather than executing a user-defined script to fix it.
Kubernetes' built-in response to a liveness probe failure is to restart the container, not to execute a separate user-defined remediation script.
When a container fails its liveness probe in Kubernetes, the kubelet kills the container, and it is then subject to its restart policy, typically resulting in a restart. Kubernetes does not automatically trigger an arbitrary user-defined script as a corrective action for a failed liveness probe.
Concept tested: Kubernetes liveness probe default action
Source: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
Topics
Community Discussion
No community discussion yet for this question.