Recall & Review
beginner
What does the command
kubectl delete pod my-pod do?It removes the pod named
my-pod from the Kubernetes cluster, stopping and deleting it.Click to reveal answer
beginner
How do you delete a deployment named
web-app using kubectl?Use the command
kubectl delete deployment web-app to remove the deployment and all its pods.Click to reveal answer
beginner
What happens if you run
kubectl delete service my-service?The service named
my-service is removed, so it no longer routes traffic to pods.Click to reveal answer
intermediate
How can you delete multiple resources at once with kubectl?
You can list multiple resources in one command, like
kubectl delete pod pod1 pod2, to remove both pods at once.Click to reveal answer
advanced
What does the flag
--force do when used with kubectl delete?It forces immediate deletion of a resource, even if it might cause issues, bypassing graceful shutdown.
Click to reveal answer
What is the correct command to delete a pod named 'test-pod'?
✗ Incorrect
The correct command to delete a pod is 'kubectl delete pod '.
Which kubectl command deletes a deployment named 'frontend'?
✗ Incorrect
Use 'kubectl delete deployment ' to delete a deployment.
What does the
--force flag do with kubectl delete?✗ Incorrect
The '--force' flag forces immediate deletion, skipping graceful shutdown.
How can you delete multiple pods named pod1 and pod2 in one command?
✗ Incorrect
Listing multiple pod names separated by space after 'kubectl delete pod' deletes them all.
What happens if you delete a service in Kubernetes?
✗ Incorrect
Deleting a service removes its routing, but pods remain running.
Explain how to delete a Kubernetes pod and what happens after deletion.
Think about the command and the pod's state after deletion.
You got /4 concepts.
Describe the use and effect of the --force flag with kubectl delete.
Consider why you might want to force delete a resource.
You got /3 concepts.