Challenge - 5 Problems
Pod Creation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of creating a pod with a missing image field?
You run the command
kubectl run mypod --restart=Never --image= with an empty image value. What will kubectl output?Kubernetes
kubectl run mypod --restart=Never --image=Attempts:
2 left
💡 Hint
The image field is mandatory when creating a pod with kubectl run.
✗ Incorrect
The --image flag is required to specify the container image. Leaving it empty causes kubectl to error out.
❓ Configuration
intermediate2:00remaining
Which YAML snippet correctly defines a pod with one container named 'web' running nginx?
Select the correct YAML configuration for a pod named 'web-pod' with a single container named 'web' using the nginx image.
Attempts:
2 left
💡 Hint
The containers field must be a list with each container having a name and image.
✗ Incorrect
Option C correctly uses the containers list with a container object having name and image fields.
🔀 Workflow
advanced2:30remaining
What is the correct sequence to create a pod from a YAML file and verify it is running?
Arrange the steps in the correct order to create a pod from a YAML file named pod.yaml and check its status.
Attempts:
2 left
💡 Hint
First create, then list, then inspect, then optionally delete.
✗ Incorrect
The correct workflow is to apply the YAML, check pods, describe the pod for details, and delete if needed.
❓ Troubleshoot
advanced1:30remaining
What error will occur if you try to create a pod with an invalid apiVersion?
You use this YAML snippet to create a pod but the apiVersion is set to 'v2':
apiVersion: v2
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: test
image: busybox
command: ['sleep', '3600']
What error will kubectl show?
Attempts:
2 left
💡 Hint
apiVersion must be a valid Kubernetes API version.
✗ Incorrect
Using an invalid apiVersion causes kubectl to fail recognizing the resource kind.
✅ Best Practice
expert2:00remaining
Which kubectl command correctly creates a pod named 'fast-pod' with the image 'nginx' and disables restart policy?
Choose the command that creates a pod named 'fast-pod' using the nginx image and ensures the pod will not restart automatically.
Attempts:
2 left
💡 Hint
The restart policy 'Never' disables automatic pod restarts.
✗ Incorrect
The kubectl run command with --restart=Never creates a pod that does not restart automatically.