KCNA · Question #120
Which of these is a valid container restart policy?
The correct answer is D. On failure. In Kubernetes, a valid container restart policy dictates how a container should be restarted after it terminates.
Question
Which of these is a valid container restart policy?
Options
- AOn login
- BOn update
- COn start
- DOn failure
How the community answered
(30 responses)- A3% (1)
- C3% (1)
- D93% (28)
Why each option
In Kubernetes, a valid container restart policy dictates how a container should be restarted after it terminates.
'On login' is not a recognized container restart policy in Kubernetes.
'On update' is not a standard container restart policy; updates typically involve creating new pods/deployments.
'On start' is not a specific container restart policy; containers generally start once unless a restart policy is triggered by termination.
The 'OnFailure' restart policy specifies that a container will only be restarted if it terminates with a non-zero exit code, indicating an error. This is a standard and common policy for resilient container applications in Kubernetes.
Concept tested: Kubernetes container restart policies
Source: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy
Topics
Community Discussion
No community discussion yet for this question.