Bird
0
0

If a pod has the following annotations:

medium📝 Command Output Q5 of 15
Kubernetes - Labels and Selectors
If a pod has the following annotations:
metadata:
  annotations:
    description: 'Test pod'
    owner: 'team-a'

What will kubectl get pods --show-labels display regarding these annotations?
AThe command will error because annotations are missing.
BAnnotations will not be shown; only labels are displayed.
CAnnotations will replace labels in the output.
DAnnotations will be displayed alongside labels.
Step-by-Step Solution
Solution:
  1. Step 1: Understand kubectl output options

    The --show-labels flag shows labels, not annotations.
  2. Step 2: Check if annotations appear in default output

    Annotations are not shown by default or with --show-labels; they require explicit commands.
  3. Final Answer:

    Annotations are not shown; only labels appear with --show-labels. -> Option B
  4. Quick Check:

    --show-labels shows labels only [OK]
Quick Trick: Annotations need special commands; labels show with --show-labels [OK]
Common Mistakes:
  • Expecting annotations in default output
  • Confusing labels and annotations display
  • Thinking command errors without labels

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes