Which of the following are valid restart policies for containers in Kubernetes?

Study for the Kubernetes Certified Network Administrator Exam. Our test offers comprehensive flashcards, multiple-choice questions, and detailed explanations. Be confident for your exam!

Multiple Choice

Which of the following are valid restart policies for containers in Kubernetes?

Explanation:
In Kubernetes, the restart behavior for containers is controlled at the Pod level with a restartPolicy in the PodSpec. It applies to all containers in that Pod. The valid values are Always, Never, and OnFailure. Always restarts containers after they exit, OnFailure restarts only if the container exits with a non-zero (failure) status, and Never does not restart containers at all. Therefore, the correct set of valid policies is Always, Never, OnFailure. Options that include Restart or OnSuccess use values that Kubernetes does not recognize as valid restart policies.

In Kubernetes, the restart behavior for containers is controlled at the Pod level with a restartPolicy in the PodSpec. It applies to all containers in that Pod. The valid values are Always, Never, and OnFailure. Always restarts containers after they exit, OnFailure restarts only if the container exits with a non-zero (failure) status, and Never does not restart containers at all. Therefore, the correct set of valid policies is Always, Never, OnFailure. Options that include Restart or OnSuccess use values that Kubernetes does not recognize as valid restart policies.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy