To delete a deployment in Minikube, run kubectl delete deployment <name>. Kubernetes removes the Deployment, then garbage collects its ReplicaSets and Pods in the background. What it does not touch is the Service you created to expose it, the ConfigMaps and Secrets it mounted, or any PersistentVolumeClaim it used. Those survive, and they are the reason a cluster you thought you cleaned up still has orphaned objects in it.
kubectl delete deployment web -n dev. Add --cascade=orphan to keep the pods running, or --cascade=foreground to block until every pod is gone. Delete the matching Service separately with kubectl delete svc web -n dev, because deleting a Deployment never removes it.This guide covers deleting by name, by label and by manifest, what the three cascade strategies actually do, how to force a pod that will not terminate, and how to wipe a whole namespace when you have lost track. Commands were checked against minikube 1.38.1 running Kubernetes v1.35.1, and they are plain kubectl, so nothing here is Minikube specific.
Deleting by name
The simplest form. Note that kubectl prints a confirmation but never asks for one.
# See what you have first
kubectl get deployments -A
kubectl delete deployment web
# deployment.apps "web" deleted
# In a specific namespace
kubectl delete deployment web -n dev
# Several at once
kubectl delete deployment web api worker -n dev
# Do not fail a script when it is already gone
kubectl delete deployment web -n dev --ignore-not-found--dry-run=client to any delete command to see exactly which objects would be targeted without touching them. It is the cheapest possible insurance against deleting the right name in the wrong namespace.Deleting by label or by manifest
Deleting by name breaks down as soon as an application is more than one object. Labels and manifests both scale better.
# Everything the label selector matches
kubectl delete deployment -l app=web -n dev
# Deployment and Service and ConfigMap in one shot
kubectl delete deployment,service,configmap -l app=web -n dev
# Whatever this file created, gone
kubectl delete -f web-deployment.yaml
# A whole directory of manifests
kubectl delete -f k8s/ --recursive
# Every deployment in a namespace, which is blunt but occasionally what you want
kubectl delete deployment --all -n devThe manifest form is the one to prefer in a project. If you created the resources with kubectl apply -f, deleting with the same file guarantees you remove precisely what you added, including the Service and the ConfigMap that a name based delete would have left behind.
Cascade strategies explained
A Deployment owns ReplicaSets, and each ReplicaSet owns Pods. The --cascade flag decides what happens to that chain. The Kubernetes documentation for kubectl delete describes it as selecting the deletion cascading strategy for the dependents, and it must be one of background, orphan or foreground.
| Strategy | Command returns | What happens to pods | Use it when |
|---|---|---|---|
background (default) | Immediately | Garbage collector removes them shortly after | Almost always |
foreground | After dependents are gone | Deleted first, then the Deployment | Scripts that must not race the next step |
orphan | Immediately | Keep running, now unmanaged | Debugging a pod after removing its controller |
# Block until the last pod is really gone
kubectl delete deployment web -n dev --cascade=foreground
# Keep the pods, drop the controller
kubectl delete deployment web -n dev --cascade=orphan
kubectl get pods -n dev # still there, and now nothing will restart them
# Wait explicitly instead, with a timeout
kubectl delete deployment web -n dev --wait=true --timeout=60skubectl apply of the same Deployment may or may not adopt them depending on whether the labels still match. Treat orphan as a debugging tool, not a deployment strategy.What survives the delete
This is the part that produces surprise leftovers. Deleting a Deployment removes only the Deployment and the objects that name it as an owner.
| Object | Deleted with the Deployment? | How to clean it up |
|---|---|---|
| ReplicaSets | Yes, they are owned | Nothing to do |
| Pods | Yes, unless you used orphan | Nothing to do |
| Service | No | kubectl delete svc web |
| ConfigMap and Secret | No | Delete by name or by label |
| PersistentVolumeClaim | No | kubectl delete pvc <name> |
| Ingress | No | Delete by name or by manifest |
| HorizontalPodAutoscaler | No | kubectl delete hpa <name> |
# Audit what is left after the deployment is gone
kubectl get svc,cm,secret,pvc,ingress,hpa -n dev
# A leftover PVC that still says Bound is holding a volume
kubectl get pvc -n dev
kubectl delete pvc data-web-0 -n devOn Minikube the storage class provisions from the node’s own disk, so a stale PVC is not costing you money the way it would on a cloud provider. It will still block a later apply if the new manifest asks for a different size or access mode, because those fields are immutable on an existing claim.
Forcing a pod that will not terminate
Occasionally a pod sits in Terminating long past its grace period. The usual causes are a container ignoring SIGTERM, a volume that will not unmount, or a finalizer waiting on a controller that no longer exists.
# Find out why before you swing the hammer
kubectl describe pod web-6d4b7c9f8-abcde -n dev | tail -30
kubectl get pod web-6d4b7c9f8-abcde -n dev -o jsonpath='{.metadata.finalizers}'
# Shorten the grace period, which is the polite escalation
kubectl delete pod web-6d4b7c9f8-abcde -n dev --now
# Last resort: drop it from the API server without waiting for the kubelet
kubectl delete pod web-6d4b7c9f8-abcde -n dev --grace-period=0 --force
# If a finalizer is the blocker, remove it explicitly
kubectl patch pod web-6d4b7c9f8-abcde -n dev \
-p '{"metadata":{"finalizers":null}}' --type=merge--force is only used when grace period is zero, and that immediate deletion of some resources may result in inconsistency or data loss. It removes the object from the API server whether or not the container actually stopped. On a StatefulSet with a shared volume this can produce two writers at once. On a local Minikube cluster the blast radius is small, so it is a reasonable habit there and a bad one in production.--now is the gentler option: it is shorthand for a one second grace period rather than zero, so the kubelet still gets a chance to send SIGTERM before the container is killed.
Cleaning a whole namespace or the whole cluster
When the point is to get back to a clean slate, work at the namespace level rather than object by object.
# Common workload kinds in one namespace
kubectl delete all --all -n dev
# The rest, which "all" does not cover
kubectl delete cm,secret,pvc,ingress --all -n dev
# Or just remove the namespace and everything in it
kubectl delete namespace dev
# Nuclear option: throw away the cluster itself
minikube delete
minikube delete --all --purgeBe aware that kubectl delete all --all does not mean every object. The all shortcut covers a fixed set of workload and service kinds, and it excludes ConfigMaps, Secrets, PVCs, Ingresses and custom resources. That is why the second command is there. If you would rather start from a fresh namespace, see our guide on creating a namespace in Minikube.
Scaling to zero instead of deleting
Often what you actually want is to free the CPU and memory without losing the object. Scaling a Deployment to zero replicas terminates every pod and keeps the manifest, the rollout history and the Service wiring intact.
kubectl scale deployment web --replicas=0 -n dev
kubectl get deploy web -n dev
# NAME READY UP-TO-DATE AVAILABLE
# web 0/0 0 0
# Bring it back exactly as it was
kubectl scale deployment web --replicas=3 -n devOn a laptop cluster this is usually the better move. It costs nothing to keep a Deployment at zero replicas, you avoid re applying manifests, and you keep the ability to roll back with kubectl rollout undo. Reserve deletion for when you genuinely want the object gone.
Troubleshooting
The deployment comes back after you delete it. Something is reconciling it. A Helm release, an Argo CD application or an operator will happily recreate the Deployment within seconds. Uninstall the release rather than deleting the object it manages.
Pods keep restarting during the delete. You deleted the pods instead of the Deployment. The ReplicaSet immediately replaces them. Delete the Deployment itself and the ReplicaSet goes with it.
Error: the server doesn’t have a resource type “deployment”. Almost always a typo or a missing kubeconfig. Confirm the cluster is reachable with kubectl cluster-info and that the profile is running with minikube status. You can find the cluster endpoint using our guide to getting the Minikube IP address.
The delete hangs forever. You used --cascade=foreground and a pod is stuck terminating. Interrupt the command, force delete that pod, and the Deployment will finish on its own. Add --timeout=60s next time so a script fails instead of hanging.
A service still resolves after the deployment is gone. Expected. The Service object survives and simply has no endpoints. Check with kubectl get endpoints web -n dev, which will show <none>, then delete the Service if you no longer need it.
Frequently asked questions
Does deleting a deployment delete its service?
No. A Service is an independent object connected to pods only by a label selector, not by ownership. Delete it separately with kubectl delete svc <name>, or delete both together using a shared label or the manifest that created them.
How do I delete a deployment without deleting its pods?
Use kubectl delete deployment web --cascade=orphan. The pods keep running but nothing manages them any longer, so they will not be restarted or rescheduled. It is useful for inspecting a failing pod after removing whatever kept replacing it.
Is minikube delete the same as deleting my deployments?
No, it is far broader. minikube delete destroys the entire cluster including its virtual machine or container, every namespace, and all stored data. Use it when you want a clean cluster. Use kubectl when you want to remove one application.
What is the difference between --now and --force?
The first is shorthand for a one second grace period, so the container still receives SIGTERM. The second only applies with a zero grace period and removes the object from the API server without waiting for the kubelet to confirm. Try the first before the second.
How can I see what a delete would remove before running it?
Add --dry-run=client to the delete command. kubectl resolves the selector or file and prints the objects it would target without contacting the API server to remove them. Pair it with -o name for a clean list you can review.
The bottom line
For everyday work, kubectl delete deployment <name> -n <namespace> is all you need, and the default background cascade is the right choice. Reach for foreground when a script has to wait, and for orphan only when you are debugging.
The habit worth building is deleting by manifest or by label rather than by name, because that is the only way you also catch the Service, ConfigMap and PVC that came along with the Deployment. When the cluster is truly beyond saving, minikube delete takes under a minute and you can rebuild from your manifests. If you are setting a cluster up from scratch, our walkthrough on installing Minikube on Windows 10 is the place to start.
About this article: GeekBlog covers U.S. technology news, AI, phones, smartwatches and gaming. Every story is written and checked under our Editorial Policy. Spotted a mistake or have a story tip? Contact our editors.

