Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
You deployed an updated background processing service to a Google Kubernetes Engine (GKE) cluster using a standard Deployment resource. Shortly after rollout, you observe that the Pods are failing to stay in a running state. Running kubectl describe pod shows the following details:
CrashLoopBackOff with an increasing Restart CountTerminatedCompleted0Which root cause explains this behavior, and what action should you take to resolve it?
In Linux and container runtimes, an exit code of 0 signifies that the main process executed to completion and exited successfully without encountering runtime errors. While this is the intended lifecycle for batch tasks managed by a Kubernetes Job or CronJob, it causes issues for long-running workloads managed by a Deployment, StatefulSet, or ReplicaSet.
Long-running workload controllers in Kubernetes are designed to ensure that application Pods remain continuously active.
kubelet enforces the Pod's default restartPolicy: Always, which dictates that any terminated container—even one that exits with code 0—must be restarted.kubelet interprets the process termination as an abnormal termination for a continuous service and initiates an automatic restart.CrashLoopBackOff despite the Reason: Completed status.To resolve this, the container image entrypoint or Pod manifest command/args must execute a persistent, long-running daemon in the foreground (such as a server process, a blocking worker loop, or tail -f /dev/null for debugging scripts) rather than a script that runs and terminates.
SIGTERM) properly.kubelet restart loops and backoff periods.Examining the container's exit code is the primary troubleshooting step in isolating container lifecycle failures. An exit code of 0 directly rules out resource constraints, network dependencies, application crashes, and probe timeouts, pinpointing container command and entrypoint design as the root cause.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.