This article covers kubectl Commands with Examples. In fact, Kubectl is a set of commands for controlling Kubernetes clusters. Every Kubernetes command has an API endpoint, and kubectl’s primary purpose is to carry out HTTP requests to the API.
While it is possible to issue HTTP requests yourself (e.g., using curl), kubectl is designed to make this process more comfortable and straightforward.
How to delete Resources using kubectl command ?
To remove resources from a file or stdin, use the kubectl delete command.
1. Remove a pod using the name and type listed in pod.yaml:
$ kubectl delete -f pod.yaml
2. Remove all pods and services with a specific label:
$ kubectl delete pods,services -l [label-key]=[label-value]
3. Remove all pods (including uninitialized pods):
$ kubectl delete pods --all