Bird
0
0

Given this Pod YAML snippet, what will be the container's name and image?

medium📝 Command Output Q13 of 15
Kubernetes - Pods
Given this Pod YAML snippet, what will be the container's name and image?
spec:
  containers:
  - name: frontend
    image: nginx:1.21
AContainer name is 'nginx' and image is 'frontend:1.21'
BContainer name is 'frontend' and image is 'nginx:latest'
CContainer name is 'frontend' and image is 'nginx:1.21'
DContainer name and image are not defined
Step-by-Step Solution
Solution:
  1. Step 1: Read the container name

    The YAML shows name: frontend, so container name is 'frontend'.
  2. Step 2: Read the container image

    The image is nginx:1.21, exactly as specified.
  3. Final Answer:

    Container name is 'frontend' and image is 'nginx:1.21' -> Option C
  4. Quick Check:

    Name and image match YAML exactly [OK]
Quick Trick: Match keys 'name' and 'image' exactly as YAML shows [OK]
Common Mistakes:
  • Swapping name and image values
  • Assuming default image tag 'latest'
  • Ignoring YAML indentation and keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes