Bird
0
0

What does the kubectl logs command do in Kubernetes?

easy📝 Conceptual Q11 of 15
Kubernetes - kubectl Essential Commands
What does the kubectl logs command do in Kubernetes?
ADeletes a pod from the cluster
BLists all pods running in the cluster
CCreates a new pod with specified configuration
DShows the output logs of a container inside a pod
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of kubectl logs

    This command is used to view the logs generated by containers running inside pods in Kubernetes.
  2. Step 2: Differentiate from other commands

    Deleting pods uses kubectl delete, creating pods uses kubectl create, and listing pods uses kubectl get pods. None of these show logs.
  3. Final Answer:

    Shows the output logs of a container inside a pod -> Option D
  4. Quick Check:

    Logs = Output from container [OK]
Quick Trick: Logs show container output, not pod creation or deletion [OK]
Common Mistakes:
  • Confusing logs with pod creation or deletion
  • Thinking logs list pods instead of showing output
  • Assuming logs show cluster-wide events

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes