0
0
Kubernetesdevops~5 mins

Deleting Pods in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What command is used to delete a pod in Kubernetes?
The command kubectl delete pod <pod-name> is used to delete a pod.
Click to reveal answer
beginner
What happens to a pod when you delete it in Kubernetes?
The pod is terminated and removed from the cluster. Any running containers inside the pod stop.
Click to reveal answer
intermediate
How can you delete multiple pods at once?
You can delete multiple pods by specifying a label selector: kubectl delete pods -l <label-selector>.
Click to reveal answer
intermediate
What option forces immediate deletion of a pod without waiting for graceful shutdown?
Use kubectl delete pod <pod-name> --grace-period=0 --force to force immediate deletion.
Click to reveal answer
intermediate
Why might a pod be recreated automatically after deletion?
If the pod is managed by a controller like a Deployment or ReplicaSet, it will recreate the pod to maintain the desired state.
Click to reveal answer
Which command deletes a pod named 'web-server'?
Akubectl stop pod web-server
Bkubectl remove pod web-server
Ckubectl delete pod web-server
Dkubectl kill pod web-server
What does the --force flag do when deleting a pod?
AForces immediate deletion without waiting for shutdown
BDeletes the pod only if it is running
CPrevents the pod from being deleted
DDeletes all pods in the namespace
How can you delete all pods with the label app=frontend?
Akubectl remove pods app=frontend
Bkubectl delete pods -l app=frontend
Ckubectl delete pod app=frontend
Dkubectl stop pods -l app=frontend
What happens if you delete a pod managed by a Deployment?
AThe Deployment recreates the pod automatically
BThe pod is deleted and not recreated
CThe Deployment is deleted too
DThe pod is paused but not deleted
Which command deletes a pod immediately without waiting for graceful shutdown?
Akubectl remove pod mypod
Bkubectl delete pod mypod --wait
Ckubectl stop pod mypod
Dkubectl delete pod mypod --grace-period=0 --force
Explain how to delete a pod in Kubernetes and what happens after deletion.
Think about the command and the pod lifecycle.
You got /4 concepts.
    Describe how to delete multiple pods using labels and why this might be useful.
    Labels help group pods for easy management.
    You got /4 concepts.