Bird
0
0

You have a deployment with pods labeled app=web and annotated version=1.2. You want to update the version annotation without changing labels. Which command is correct?

hard📝 Application Q9 of 15
Kubernetes - Labels and Selectors
You have a deployment with pods labeled app=web and annotated version=1.2. You want to update the version annotation without changing labels. Which command is correct?
Akubectl annotate pods -l app=web version='1.3' --overwrite
Bkubectl label pods -l app=web version='1.3' --overwrite
Ckubectl annotate pods version='1.3' --overwrite
Dkubectl label pods version='1.3' --overwrite
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to update annotations selectively

    Use 'kubectl annotate' with label selector to target pods and update annotation.
  2. Step 2: Confirm correct syntax and flags

    kubectl annotate pods -l app=web version='1.3' --overwrite uses correct selector, annotation key=value, and --overwrite to update existing annotation.
  3. Final Answer:

    Use 'kubectl annotate pods -l app=web version='1.3' --overwrite'. -> Option A
  4. Quick Check:

    Update annotations with 'annotate' and --overwrite [OK]
Quick Trick: Use annotate with -l selector and --overwrite to update annotations [OK]
Common Mistakes:
  • Using label command to update annotations
  • Missing --overwrite flag
  • Not using label selector to target pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes