Delete resources by filenames, stdin, resources and names, or by resources and label selector.
JSON and YAML formats are accepted. Only one type of the arguments may be specified: filenames, resources and names, or resources and label selector.
$ kubectl delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)])
$ kubectl get deployment NAME READY UP-TO-DATE AVAILABLE AGE nginx 1/1 1 1 44s $ kubectl get pods NAME READY STATUS RESTARTS AGE nginx-6db489d4b7-9wgn9 1/1 Running 0 28s
$ kubectl delete deployments nginx deployment.apps "nginx" deleted
$ kubectl get deployments No resources found in default namespace.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.