Bird
0
0

You want to add multiple labels env=prod and version=v1 to a service named backend. Which command is correct?

hard📝 Application Q8 of 15
Kubernetes - Labels and Selectors
You want to add multiple labels env=prod and version=v1 to a service named backend. Which command is correct?
Akubectl label service backend -l env=prod version=v1
Bkubectl label service backend env=prod version=v1
Ckubectl label service backend env=prod,version=v1
Dkubectl label service backend env=prod; version=v1
Step-by-Step Solution
Solution:
  1. Step 1: Recall syntax for multiple labels

    Multiple labels are added by listing key=value pairs separated by spaces.
  2. Step 2: Identify correct command

    kubectl label service backend env=prod version=v1 correctly lists labels separated by space without extra characters.
  3. Final Answer:

    kubectl label service backend env=prod version=v1 -> Option B
  4. Quick Check:

    Multiple labels separated by spaces [OK]
Quick Trick: Separate multiple labels with spaces, not commas or semicolons [OK]
Common Mistakes:
  • Using commas or semicolons between labels
  • Adding unnecessary flags like -l
  • Incorrect label formatting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes