Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
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?
spec.containers[].resources.limits.memory in the Deployment manifest.When a container consumes more memory than allowed by its configured limit or exhausts the host node's allocatable memory, the Linux kernel terminates the offending process with an Out Of Memory (OOM) kill.
137 (128 + signal 9 SIGKILL), not exit code 0.kubectl describe pod, the container's Last State would explicitly display Reason: OOMKilled rather than Reason: Completed.kubernetes.io/container/memory/limit_utilization would show saturation near 1.0 prior to termination, which is inconsistent with a clean process completion.SIGKILL by the operating system kernel.Last State in the Pod status.The kubectl describe pod output showed Reason: OOMKilled, an Exit Code: 137, and Cloud Monitoring metrics indicated that container/memory/used_bytes reached resources.limits.memory before each restart.
initialDelaySeconds and failureThreshold in the liveness probe configuration.Kubernetes liveness probes verify whether an application container is healthy and actively running. If a liveness probe fails consecutively past the configured failureThreshold, the kubelet terminates the container and restarts it according to its restart policy.
kubelet sends a SIGTERM (and subsequently SIGKILL if unhandled) to the container. The Pod's event log will report explicit warning events such as Unhealthy: Liveness probe failed: ....143 for SIGTERM or 137 for SIGKILL) or a non-zero exit code if the app crashes during probe evaluation, rather than Exit Code: 0 with Reason: Completed.kubelet aborted it due to a failed probe check.Warning Unhealthy events detailing the probe target failure (e.g., HTTP status code or connection timeout).initialDelaySeconds, startupProbe, or increasing failureThreshold.The Pod events log showed repeated Liveness probe failed warnings and the container was prematurely killed while still actively performing startup routines.
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.
targetPort to match containerPort and redeploy the Ingress resource.When exposing GKE workloads through Ingress with container-native load balancing, the Google Cloud load balancer uses inferred parameters from the Pod's readiness probe or an associated BackendConfig to perform HTTP(S) health checks against backend network endpoint groups (NEGs).
CrashLoopBackOff.kubelet does not restart containers simply because an external load balancer health check or readiness probe fails. Only liveness probe failures or process exits cause container restarts.Exit Code: 0.Readiness probe failed: connection refused.Running state (0/1 Ready).The Pod status remained Running with Ready: 0/1, application logs showed the service listening on a specific port, and Cloud Load Balancing backend health checks were failing due to mismatched port definitions.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated