DELAPARRA
Index
Color
NL
Category: Kubernetes

delete

Explained by Updated

What is delete?

delete: Remove resources by name, label, or file. Deleting a Deployment also removes its Pods. kubectl delete removes resources from a Kubernetes cluster, by name, label or the file that created them. kubectl delete -f deployment.yaml removes everything defined in that file. Deleting a Deployment also removes the pods it manages. Deleting a single pod that belongs to a Deployment does not really remove it; the Deployment starts a replacement straight away. That makes kubectl delete pod a common way to restart a misbehaving pod.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about delete

What should you keep in mind with delete?

Be careful with labels and namespaces. kubectl delete pods -l app=web in the wrong namespace, or kubectl delete namespace, can remove far more than intended, including data in persistent volumes depending on their policy. Check your current context with kubectl config current-context before deleting anything, especially when you work with several clusters.

What does an example of delete look like?

kubectl delete pod web-7d9f8c-abc12 kubectl delete -f deployment.yaml

At a glance

CategoryKubernetes
Explained by
Updated

More Kubernetes terms

All terms starting with D

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.