kubectl delete <TYPE | TYPE/NAME> [Resource]

Delete resources by filenames, stdin, resources and names, or by resources and label selector

Arguments

NameDescription
TYPE | TYPE/NAME
Resource

Options

NameDescription
--dry-run <Strategy>Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource
-f, --filename <File>Filename, directory, or URL to files identifying the resource
-k, --kustomize <Kustomize Dir>Process the kustomization directory. This flag can't be used together with -f or -R
-o, --output <Output Format>Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file
-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory
-l, --selector <arg>Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--allSelect all resources, including uninitialized ones, in the namespace of the specified resource types
--field-selector <arg>Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type
-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace
--cascadeIf true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true
--forceIf true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation
--grace-period <INT (Seconds)>Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion)
--ignore-not-foundTreat "resource not found" as a successful delete. Defaults to "true" when --all is specified
--nowIf true, resources are signaled for immediate shutdown (same as --grace-period=1)
--rawRaw URI to DELETE to the server. Uses the transport specified by the kubeconfig file
--timeout <INT (Seconds)>The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object
--waitIf true, wait for resources to be gone before returning. This waits for finalizers