Courseiva
Troubleshooting →mediumMultiple Choice

CKA CrashLoopBackOff with no logs Practice Question

A Pod is stuck in CrashLoopBackOff. You run `kubectl logs <pod-name>` but see no output. What is the most likely cause?

⚠ Common exam trap

Test-takers frequently assume empty logs indicate a logging infrastructure issue (like kubelet failure) rather than recognizing that the container simply never produced any output before crashing.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

The container crashes before writing to stdout/stderr.

When a container crashes before it can write any output to stdout or stderr, `kubectl logs` returns no output because there is no log data to retrieve. This is a common symptom of a container that fails during initialization or immediately upon entry point execution, before any logging occurs.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    The pod has no container defined.

    Why it's wrong here

    If a Pod spec had no containers, the API server would reject it during admission with a validation error such as 'must specify at least one container'; it would never be scheduled and therefore cannot enter CrashLoopBackOff. CrashLoopBackOff is a kubelet-reported container state, meaning a container process exists and repeatedly exits after start. The absence of logs in this scenario points to process-level failure, not a missing container in the manifest.

  • ✓

    The container crashes before writing to stdout/stderr.

    Why this is correct

    When a container enters CrashLoopBackOff, the kubelet has successfully started the process and the runtime is restarting it because of a non-zero exit. If the application dies immediately—for example, due to a missing executable, an invalid ENTRYPOINT, a panic before logging setup, or an exec format error—there is no stdout/stderr capture for kubectl logs to return. The restart count increments and the container's state becomes Waiting with reason CrashLoopBackOff, but the logs remain empty.

  • ✗

    The kubelet is not forwarding logs.

    Why it's wrong here

    The kubelet is not a log-forwarding agent; it relies on the container runtime to capture stdout/stderr and then exposes those captured logs through the Kubernetes API. If the kubelet were failing to retrieve or forward logs, you would typically see errors from kubectl logs (e.g., 'unable to retrieve container logs') or the pod would not be running at all. A functioning kubelet reporting a CrashLoopBackOff status has already gathered enough runtime state to know the container is crashing, so the missing logs are explained by the container's behavior, not by kubelet transport.

  • ✗

    The pod is in a different namespace.

    Why it's wrong here

    If the Pod were in another namespace, kubectl logs would return a NotFound error because the default namespace does not contain that Pod; it would not return empty output. The CrashLoopBackOff status is visible only when querying the correct namespace, and no log output is still the symptom. Namespace does not influence how the container runtime captures logs; it is merely a scoping mechanism, so it cannot cause a container to have no logs.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The CKA exam frequently reuses these exact scenarios with slightly different constraints.

✓The container crashes before writing to stdout/stderr.Correct answer▾

Why this is correct

When a container enters CrashLoopBackOff, the kubelet has successfully started the process and the runtime is restarting it because of a non-zero exit. If the application dies immediately—for example, due to a missing executable, an invalid ENTRYPOINT, a panic before logging setup, or an exec format error—there is no stdout/stderr capture for kubectl logs to return. The restart count increments and the container's state becomes Waiting with reason CrashLoopBackOff, but the logs remain empty.

✗The pod has no container defined.Wrong answer — click to see why▾

Why this is wrong here

A pod must have at least one container; if not, it wouldn't be scheduled.

✗The kubelet is not forwarding logs.Wrong answer — click to see why▾

Why this is wrong here

The kubelet forwards logs from the container runtime; if logs exist, they should appear.

✗The pod is in a different namespace.Wrong answer — click to see why▾

Why this is wrong here

kubectl logs defaults to the default namespace; if the pod is in another namespace, you'd get an error, not empty output.

Analysis generated from the official CKAblueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

About these practice questions

One of 726 original CKA practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKA practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKA exam.