2021-10-24 13:15:36 +01:00
|
|
|
# kubectl delete
|
|
|
|
|
|
|
|
> Delete Kubernetes resources.
|
|
|
|
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#delete>.
|
|
|
|
|
|
|
|
- Delete a specific pod:
|
|
|
|
|
|
|
|
`kubectl delete pod {{pod_name}}`
|
|
|
|
|
|
|
|
- Delete a specific deployment:
|
|
|
|
|
2022-02-20 03:59:28 +00:00
|
|
|
`kubectl delete deployment {{deployment_name}}`
|
2021-10-24 13:15:36 +01:00
|
|
|
|
|
|
|
- Delete a specific node:
|
|
|
|
|
|
|
|
`kubectl delete node {{node_name}}`
|
|
|
|
|
|
|
|
- Delete all pods in a specified namespace:
|
|
|
|
|
|
|
|
`kubectl delete pods --all --namespace {{namespace}}`
|
|
|
|
|
|
|
|
- Delete all deployments and services in a specified namespace:
|
|
|
|
|
|
|
|
`kubectl delete deployments,services --all --namespace {{namespace}}`
|
|
|
|
|
|
|
|
- Delete all nodes:
|
|
|
|
|
|
|
|
`kubectl delete nodes --all`
|
|
|
|
|
|
|
|
- Delete resources defined in a YAML manifest:
|
|
|
|
|
|
|
|
`kubectl delete --filename {{path/to/manifest.yaml}}`
|