Courseiva

CKAD Application Observability and Maintenance Practice Question

Which kubectl command streams logs from a pod named 'web-pod' in real-time?

⚠ Common exam trap

Test-takers frequently confuse flags like `--tail` or `--since` with real-time streaming, not realizing that only `-f` (or `--follow`) provides continuous log output.

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

✓

kubectl logs -f web-pod

The `-f` flag (short for `--follow`) tells kubectl to stream logs from the pod in real-time, similar to `tail -f` on a file. This is essential for live monitoring of application output as it is generated.

Answer analysis

Option-by-option breakdown

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

  • ✗

    kubectl logs --since=5m web-pod

    Why it's wrong here

    --since=5m prints entries from the last five minutes and then exits; it does not follow the stream. It is tempting for recent troubleshooting, where a bounded window is exactly what you want, but real-time streaming requires the -f flag.

  • ✗

    kubectl logs --tail=100 web-pod

    Why it's wrong here

    --tail=100 prints the final hundred lines and returns to the prompt without following. It is tempting for inspecting recent output quickly, which suits post-incident review, but continuous streaming requires -f to keep the connection open.

  • ✓

    kubectl logs -f web-pod

    Why this is correct

    The -f flag follows the log stream, keeping the connection open and outputting new entries as they are generated rather than returning existing logs and exiting. This delivers the real-time streaming required for the named pod.

  • ✗

    kubectl logs web-pod

    Why it's wrong here

    Plain kubectl logs dumps the pod's current log buffer and exits; it never follows new entries. It is tempting because it is the base command everyone learns first, and it suffices for reading historical output, but real-time streaming needs the -f flag added.

About these practice questions

One of 826 original CKAD 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 CKAD 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 CKAD exam.