Bird
0
0

Which of the following is the correct syntax to view logs of a pod named webserver?

easy📝 Syntax Q3 of 15
Kubernetes - Pods
Which of the following is the correct syntax to view logs of a pod named webserver?
Akubectl get logs webserver
Bkubectl logs webserver
Ckubectl describe logs webserver
Dkubectl show logs webserver
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct command for logs

    The correct command to view logs is kubectl logs <pod-name>.
  2. Step 2: Check other options

    kubectl get logs, kubectl describe logs, and kubectl show logs are invalid commands.
  3. Final Answer:

    kubectl logs webserver -> Option B
  4. Quick Check:

    View pod logs = kubectl logs podname [OK]
Quick Trick: Use 'kubectl logs podname' to see pod logs [OK]
Common Mistakes:
  • Using 'kubectl get logs'
  • Using 'kubectl describe logs'
  • Using 'kubectl show logs'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes