Bird
0
0

What will be the output of the command kubectl logs mypod --follow?

medium📝 Command Output Q13 of 15
Kubernetes - Pods
What will be the output of the command kubectl logs mypod --follow?
AIt shows the logs of 'mypod' and continues to stream new log entries live.
BIt shows only the last 10 lines of logs from 'mypod'.
CIt describes the pod 'mypod' with detailed info and events.
DIt executes a shell inside the 'mypod' container.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the '--follow' flag with 'kubectl logs'

    The '--follow' option streams logs live, showing new entries as they appear.
  2. Step 2: Match the output description

    The command outputs current logs and keeps streaming new logs live for 'mypod'.
  3. Final Answer:

    It shows the logs of 'mypod' and continues to stream new log entries live. -> Option A
  4. Quick Check:

    kubectl logs --follow = live log streaming [OK]
Quick Trick: Add '--follow' to stream pod logs live as they appear [OK]
Common Mistakes:
  • Thinking '--follow' limits logs to last 10 lines
  • Confusing logs with pod description
  • Assuming it opens a shell inside the pod

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes