0
0
Kubernetesdevops~5 mins

kubectl delete for removal in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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'?
Akubectl erase pod test-pod
Bkubectl remove pod test-pod
Ckubectl stop pod test-pod
Dkubectl delete pod test-pod
Which kubectl command deletes a deployment named 'frontend'?
Akubectl stop deployment frontend
Bkubectl remove deployment frontend
Ckubectl delete deployment frontend
Dkubectl erase deployment frontend
What does the --force flag do with kubectl delete?
AForces immediate deletion without waiting for graceful shutdown
BPrevents deletion of the resource
CDeletes only if resource is not in use
DSchedules deletion for later
How can you delete multiple pods named pod1 and pod2 in one command?
Akubectl delete pod pod1 pod2
Bkubectl delete pods pod1,pod2
Ckubectl remove pod pod1 pod2
Dkubectl delete pod pod1; pod2
What happens if you delete a service in Kubernetes?
APods are deleted automatically
BThe service stops routing traffic to pods
CThe cluster shuts down
DNothing happens
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.