Bird
0
0

Which command correctly adds the label role=frontend to a pod named app-pod?

easy📝 Syntax Q3 of 15
Kubernetes - Labels and Selectors
Which command correctly adds the label role=frontend to a pod named app-pod?
Akubectl add label pod app-pod role=frontend
Bkubectl label pod app-pod role=frontend
Ckubectl set label pod app-pod role=frontend
Dkubectl apply label pod app-pod role=frontend
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct command

    The command to add labels is kubectl label.
  2. Step 2: Syntax check

    The syntax is kubectl label pod <pod-name> key=value.
  3. Final Answer:

    kubectl label pod app-pod role=frontend -> Option B
  4. Quick Check:

    Use kubectl label to add labels [OK]
Quick Trick: Use 'kubectl label' to add labels [OK]
Common Mistakes:
  • Using 'kubectl add label' which is invalid
  • Confusing 'set label' or 'apply label' commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes