Challenge - 5 Problems
Kubectl Delete Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of deleting a non-existent pod?
You run the command
kubectl delete pod mypod but the pod mypod does not exist in the current namespace. What will be the output?Kubernetes
kubectl delete pod mypodAttempts:
2 left
💡 Hint
Think about what Kubernetes says when you try to delete something that isn't there.
✗ Incorrect
When you try to delete a pod that does not exist, Kubernetes returns a 'NotFound' error indicating the pod was not found.
💻 Command Output
intermediate2:00remaining
What happens when you delete a deployment with --cascade=false?
You run
kubectl delete deployment mydeploy --cascade=false. What is the effect on the pods managed by this deployment?Kubernetes
kubectl delete deployment mydeploy --cascade=falseAttempts:
2 left
💡 Hint
Consider what 'cascade' means in Kubernetes deletion.
✗ Incorrect
Using --cascade=false deletes only the deployment resource but leaves the pods running.
❓ Troubleshoot
advanced2:00remaining
Why does 'kubectl delete pod' hang indefinitely?
You run
kubectl delete pod mypod but the command hangs and never completes. What is the most likely cause?Kubernetes
kubectl delete pod mypodAttempts:
2 left
💡 Hint
Think about what can prevent Kubernetes from fully deleting a resource.
✗ Incorrect
A finalizer on the pod can block deletion until certain cleanup steps complete, causing kubectl delete to hang.
✅ Best Practice
advanced2:00remaining
Which command safely deletes all pods with label app=web in namespace prod?
You want to delete all pods labeled
app=web in the prod namespace without affecting other resources. Which command is best?Attempts:
2 left
💡 Hint
Focus on deleting only pods, not other resource types.
✗ Incorrect
Deleting pods with label selector in the specific namespace deletes only those pods safely.
🧠 Conceptual
expert2:00remaining
What is the effect of 'kubectl delete --force --grace-period=0 pod mypod'?
You run
kubectl delete --force --grace-period=0 pod mypod. What happens to the pod?Attempts:
2 left
💡 Hint
Consider what --force and --grace-period=0 do together.
✗ Incorrect
Using --force with --grace-period=0 forces immediate pod removal without waiting for shutdown.