.TH "OC" "1" " Openshift CLI User Manuals" "Openshift" "June 2016"  ""


.SH NAME
.PP
oc delete \- Delete one or more resources


.SH SYNOPSIS
.PP
\fBoc delete\fP [OPTIONS]


.SH DESCRIPTION
.PP
Delete a resource

.PP
JSON and YAML formats are accepted.

.PP
If both a filename and command line arguments are passed, the command line arguments are used and the filename is ignored.

.PP
Note that the delete command does NOT do resource version checks, so if someone submits an update to a resource right when you submit a delete, their update will be lost along with the rest of the resource.


.SH OPTIONS
.PP
\fB\-\-all\fP=false
    [\-all] to select all the specified resources.

.PP
\fB\-\-cascade\fP=true
    If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController).  Default true.

.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
    Filename, directory, or URL to a file containing the resource to delete.

.PP
\fB\-\-grace\-period\fP=\-1
    Period of time in seconds given to the resource to terminate gracefully. Ignored if negative.

.PP
\fB\-\-ignore\-not\-found\fP=false
    Treat "resource not found" as a successful delete. Defaults to "true" when \-\-all is specified.

.PP
\fB\-\-include\-extended\-apis\fP=true
    If true, include definitions of new APIs via calls to the API server. [default true]

.PP
\fB\-\-now\fP=false
    If true, resources are force terminated without graceful deletion (same as \-\-grace\-period=0).

.PP
\fB\-o\fP, \fB\-\-output\fP=""
    Output mode. Use "\-o name" for shorter output (resource/name).

.PP
\fB\-R\fP, \fB\-\-recursive\fP=false
    Process the directory used in \-f, \-\-filename recursively. Useful when you want to manage related manifests organized within the same directory.

.PP
\fB\-l\fP, \fB\-\-selector\fP=""
    Selector (label query) to filter on.

.PP
\fB\-\-timeout\fP=0
    The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-api\-version\fP=""
    DEPRECATED: The API version to use when talking to the server

.PP
\fB\-\-as\fP=""
    Username to impersonate for the operation

.PP
\fB\-\-certificate\-authority\fP=""
    Path to a cert. file for the certificate authority

.PP
\fB\-\-client\-certificate\fP=""
    Path to a client certificate file for TLS

.PP
\fB\-\-client\-key\fP=""
    Path to a client key file for TLS

.PP
\fB\-\-cluster\fP=""
    The name of the kubeconfig cluster to use

.PP
\fB\-\-config\fP=""
    Path to the config file to use for CLI requests.

.PP
\fB\-\-context\fP=""
    The name of the kubeconfig context to use

.PP
\fB\-\-google\-json\-key\fP=""
    The Google Cloud Platform Service Account JSON Key to use for authentication.

.PP
\fB\-\-insecure\-skip\-tls\-verify\fP=false
    If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure

.PP
\fB\-\-log\-flush\-frequency\fP=0
    Maximum number of seconds between log flushes

.PP
\fB\-\-match\-server\-version\fP=false
    Require server version to match client version

.PP
\fB\-n\fP, \fB\-\-namespace\fP=""
    If present, the namespace scope for this CLI request

.PP
\fB\-\-request\-timeout\fP="0"
    The length of time to wait before giving up on a single server request. Non\-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.

.PP
\fB\-\-server\fP=""
    The address and port of the Kubernetes API server

.PP
\fB\-\-token\fP=""
    Bearer token for authentication to the API server

.PP
\fB\-\-user\fP=""
    The name of the kubeconfig user to use


.SH EXAMPLE
.PP
.RS

.nf
  # Delete a pod using the type and ID specified in pod.json.
  oc delete \-f pod.json
  
  # Delete a pod based on the type and ID in the JSON passed into stdin.
  cat pod.json | oc delete \-f \-
  
  # Delete pods and services with label name=myLabel.
  oc delete pods,services \-l name=myLabel
  
  # Delete a pod with name node\-1\-vsjnm.
  oc delete pod node\-1\-vsjnm
  
  # Delete all resources associated with a running app, includes
  # buildconfig,deploymentconfig,service,imagestream,route and pod,
  # where 'appName' is listed in 'Labels' of 'oc describe [resource] [resource name]' output.
  oc delete all \-l app=appName
  
  # Delete all pods
  oc delete pods \-\-all

.fi
.RE


.SH SEE ALSO
.PP
\fBoc(1)\fP,


.SH HISTORY
.PP
June 2016, Ported from the Kubernetes man\-doc generator