Challenge - 5 Problems
Pod YAML Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of a simple Pod creation command
What is the output when you run
kubectl apply -f pod.yaml with the following Pod definition?Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: nginx
image: nginx:latestAttempts:
2 left
💡 Hint
Check the output message after applying a valid Pod YAML file.
✗ Incorrect
When you apply a valid Pod YAML file for the first time, kubectl outputs 'pod/ created'.
🧠 Conceptual
intermediate2:00remaining
Understanding Pod restart policy
Given this Pod YAML snippet, what is the effect of the
restartPolicy: Never setting?Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
restartPolicy: Never
containers:
- name: busybox
image: busybox
command: ['sleep', '3600']Attempts:
2 left
💡 Hint
Think about what 'Never' means for restart behavior.
✗ Incorrect
The restartPolicy 'Never' means the container will not be restarted automatically if it stops or crashes.
❓ Configuration
advanced2:00remaining
Correct YAML for multiple containers in a Pod
Which YAML snippet correctly defines a Pod with two containers named
app and sidecar?Attempts:
2 left
💡 Hint
Check the key name for the list of containers and the indentation.
✗ Incorrect
The key must be 'containers' (plural) with a list of container objects each having 'name' and 'image'.
❓ Troubleshoot
advanced2:00remaining
Diagnosing Pod creation failure due to missing fields
You try to create a Pod with this YAML but get an error. What is the most likely cause?
Kubernetes
apiVersion: v1 kind: Pod metadata: name: incomplete-pod spec: containers: - image: nginx
Attempts:
2 left
💡 Hint
Check the required fields inside each container definition.
✗ Incorrect
Each container must have a 'name' field; missing it causes Pod creation to fail.
✅ Best Practice
expert2:00remaining
Best practice for labeling Pods in YAML
Which YAML snippet follows best practices for labeling a Pod to enable easy selection and management?
Attempts:
2 left
💡 Hint
Labels should be under metadata and use clear key names.
✗ Incorrect
Labels belong under metadata.labels and should be descriptive for easy selection.