Bird
0
0

You wrote this init container spec but the Pod fails to start:

medium📝 Troubleshoot Q6 of 15
Kubernetes - Pods
You wrote this init container spec but the Pod fails to start:
initContainers:
- name: setup
  image: busybox
  command: 'echo Hello'

What is the error?
AThe command should be a list, not a string
BThe image 'busybox' is invalid
CThe init container name is missing
DInit containers cannot use 'echo' command
Step-by-Step Solution
Solution:
  1. Step 1: Check command field format

    The command field must be a list of strings, not a single string.
  2. Step 2: Identify correct syntax

    Correct syntax: command: ['echo', 'Hello'] or command: ['sh', '-c', 'echo Hello']
  3. Final Answer:

    The command should be a list, not a string -> Option A
  4. Quick Check:

    Command syntax in init container = List [OK]
Quick Trick: Use list syntax for command in containers [OK]
Common Mistakes:
  • Using string instead of list for command
  • Assuming image name is wrong
  • Thinking 'echo' is invalid command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes