Bird
0
0

Which of the following is the correct syntax to delete all pods with the label app=frontend?

easy📝 Syntax Q12 of 15
Kubernetes - Pods
Which of the following is the correct syntax to delete all pods with the label app=frontend?
Akubectl delete pods --label app=frontend
Bkubectl delete pod --label app=frontend
Ckubectl delete pod -l app=frontend
Dkubectl remove pod -l app=frontend
Step-by-Step Solution
Solution:
  1. Step 1: Use the correct resource type and label flag

    The resource type for pods is pod (singular) and the label selector flag is -l.
  2. Step 2: Form the correct command

    The correct command is kubectl delete pod -l app=frontend to delete pods matching the label.
  3. Final Answer:

    kubectl delete pod -l app=frontend -> Option C
  4. Quick Check:

    Delete pods by label = kubectl delete pod -l LABEL [OK]
Quick Trick: Use '-l' flag with 'kubectl delete pod' to delete by label [OK]
Common Mistakes:
  • Using plural 'pods' instead of 'pod'
  • Using '--label' instead of '-l'
  • Using 'remove' instead of 'delete'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes