kubectl delete
The kubectl command that removes objects from the cluster.
It acts immediately on whichever cluster and namespace your context points at.
In more detail
Deleting a bare pod leaves nothing running, while deleting a pod that a controller owns just prompts a replacement. That difference is exactly what a controller adds. Check your context before deleting anything.
Example
kubectl delete pod -l app=web --nowRelated terms
- kubectl — The command-line tool for talking to a Kubernetes cluster's API server: creating, reading, changing and deleting objects.
- kubeconfig context — A named pairing in a kubeconfig of one cluster, one user and an optional default namespace; the current context decides where kubectl goes.
- Kubernetes controller — A program inside or alongside the cluster that watches one kind of object and keeps acting until reality matches what that object asks for.
Taught in
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration