kubectl-delete
removes Kubernetes resources
TLDR
Delete pod
SYNOPSIS
kubectl delete [options] resource [name]
DESCRIPTION
kubectl delete removes one or more resources from a Kubernetes cluster. It can target resources by name, label selector, or by referencing the same manifest files used to create them, making it straightforward to tear down everything defined in a YAML file or directory.
By default, the command sends a graceful termination signal and waits for the resource's grace period (typically 30 seconds for pods) before forcibly removing it. During this window, pods receive a SIGTERM and can perform cleanup operations like draining connections or saving state. The `--force --grace-period=0` flags bypass graceful shutdown and immediately remove the resource from the API server, which is useful for stuck pods but may cause data loss.
Deleting higher-level resources like deployments or statefulsets cascades to their managed pods by default. Deleting a namespace removes all resources within it, so this operation should be used with caution in shared environments.
PARAMETERS
RESOURCE
Resource type.NAME
Resource name.-f FILE
Delete from file.-l SELECTOR
Label selector.--all
Delete all resources.--force
Force deletion.--grace-period N
Grace period seconds.--help
Display help information.
CAVEATS
Subcommand of kubectl. Destructive operation. Consider --dry-run first.
HISTORY
kubectl delete provides resource removal for Kubernetes cluster management.
SEE ALSO
kubectl(1), kubectl-apply(1), kubectl-create(1)
