1OC(1) June 2016 OC(1)
2
3
4
6 oc delete - Delete one or more resources
7
8
9
11 oc delete [OPTIONS]
12
13
14
16 Delete a resource
17
18
19 JSON and YAML formats are accepted.
20
21
22 If both a filename and command line arguments are passed, the command
23 line arguments are used and the filename is ignored.
24
25
26 Note that the delete command does NOT do resource version checks, so if
27 someone submits an update to a resource right when you submit a delete,
28 their update will be lost along with the rest of the resource.
29
30
31
33 --all=false
34 Delete all resources, including uninitialized ones, in the names‐
35 pace of the specified resource types.
36
37
38 --cascade=true
39 If true, cascade the deletion of the resources managed by this
40 resource (e.g. Pods created by a ReplicationController). Default true.
41
42
43 --field-selector=""
44 Selector (field query) to filter on, supports '=', '==', and
45 '!='.(e.g. --field-selector key1=value1,key2=value2). The server only
46 supports a limited number of field queries per type.
47
48
49 -f, --filename=[]
50 containing the resource to delete.
51
52
53 --force=false
54 Only used when grace-period=0. If true, immediately remove
55 resources from API and bypass graceful deletion. Note that immediate
56 deletion of some resources may result in inconsistency or data loss and
57 requires confirmation.
58
59
60 --grace-period=-1
61 Period of time in seconds given to the resource to terminate grace‐
62 fully. Ignored if negative. Set to 1 for immediate shutdown. Can only
63 be set to 0 when --force is true (force deletion).
64
65
66 --ignore-not-found=false
67 Treat "resource not found" as a successful delete. Defaults to
68 "true" when --all is specified.
69
70
71 --include-uninitialized=false
72 If true, the kubectl command applies to uninitialized objects. If
73 explicitly set to false, this flag overrides other flags that make the
74 kubectl commands apply to uninitialized objects, e.g., "--all". Objects
75 with empty metadata.initializers are regarded as initialized.
76
77
78 --now=false
79 If true, resources are signaled for immediate shutdown (same as
80 --grace-period=1).
81
82
83 -o, --output=""
84 Output mode. Use "-o name" for shorter output (resource/name).
85
86
87 -R, --recursive=false
88 Process the directory used in -f, --filename recursively. Useful
89 when you want to manage related manifests organized within the same
90 directory.
91
92
93 -l, --selector=""
94 Selector (label query) to filter on, not including uninitialized
95 ones.
96
97
98 --timeout=0
99 The length of time to wait before giving up on a delete, zero means
100 determine a timeout from the size of the object
101
102
103 --wait=true
104 If true, wait for resources to be gone before returning. This waits
105 for finalizers.
106
107
108
110 --allow_verification_with_non_compliant_keys=false
111 Allow a SignatureVerifier to use keys which are technically
112 non-compliant with RFC6962.
113
114
115 --alsologtostderr=false
116 log to standard error as well as files
117
118
119 --application_metrics_count_limit=100
120 Max number of application metrics to store (per container)
121
122
123 --as=""
124 Username to impersonate for the operation
125
126
127 --as-group=[]
128 Group to impersonate for the operation, this flag can be repeated
129 to specify multiple groups.
130
131
132 --azure-container-registry-config=""
133 Path to the file containing Azure container registry configuration
134 information.
135
136
137 --boot_id_file="/proc/sys/kernel/random/boot_id"
138 Comma-separated list of files to check for boot-id. Use the first
139 one that exists.
140
141
142 --cache-dir="/builddir/.kube/http-cache"
143 Default HTTP cache directory
144
145
146 --certificate-authority=""
147 Path to a cert file for the certificate authority
148
149
150 --client-certificate=""
151 Path to a client certificate file for TLS
152
153
154 --client-key=""
155 Path to a client key file for TLS
156
157
158 --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
159 CIDRs opened in GCE firewall for LB traffic proxy health checks
160
161
162 --cluster=""
163 The name of the kubeconfig cluster to use
164
165
166 --container_hints="/etc/cadvisor/container_hints.json"
167 location of the container hints file
168
169
170 --containerd="unix:///var/run/containerd.sock"
171 containerd endpoint
172
173
174 --context=""
175 The name of the kubeconfig context to use
176
177
178 --default-not-ready-toleration-seconds=300
179 Indicates the tolerationSeconds of the toleration for
180 notReady:NoExecute that is added by default to every pod that does not
181 already have such a toleration.
182
183
184 --default-unreachable-toleration-seconds=300
185 Indicates the tolerationSeconds of the toleration for unreach‐
186 able:NoExecute that is added by default to every pod that does not
187 already have such a toleration.
188
189
190 --docker="unix:///var/run/docker.sock"
191 docker endpoint
192
193
194 --docker-tls=false
195 use TLS to connect to docker
196
197
198 --docker-tls-ca="ca.pem"
199 path to trusted CA
200
201
202 --docker-tls-cert="cert.pem"
203 path to client certificate
204
205
206 --docker-tls-key="key.pem"
207 path to private key
208
209
210 --docker_env_metadata_whitelist=""
211 a comma-separated list of environment variable keys that needs to
212 be collected for docker containers
213
214
215 --docker_only=false
216 Only report docker containers in addition to root stats
217
218
219 --docker_root="/var/lib/docker"
220 DEPRECATED: docker root is read from docker info (this is a fall‐
221 back, default: /var/lib/docker)
222
223
224 --enable_load_reader=false
225 Whether to enable cpu load reader
226
227
228 --event_storage_age_limit="default=24h"
229 Max length of time for which to store events (per type). Value is a
230 comma separated list of key values, where the keys are event types
231 (e.g.: creation, oom) or "default" and the value is a duration. Default
232 is applied to all non-specified event types
233
234
235 --event_storage_event_limit="default=100000"
236 Max number of events to store (per type). Value is a comma sepa‐
237 rated list of key values, where the keys are event types (e.g.: cre‐
238 ation, oom) or "default" and the value is an integer. Default is
239 applied to all non-specified event types
240
241
242 --global_housekeeping_interval=0
243 Interval between global housekeepings
244
245
246 --housekeeping_interval=0
247 Interval between container housekeepings
248
249
250 --insecure-skip-tls-verify=false
251 If true, the server's certificate will not be checked for validity.
252 This will make your HTTPS connections insecure
253
254
255 --kubeconfig=""
256 Path to the kubeconfig file to use for CLI requests.
257
258
259 --log-flush-frequency=0
260 Maximum number of seconds between log flushes
261
262
263 --log_backtrace_at=:0
264 when logging hits line file:N, emit a stack trace
265
266
267 --log_cadvisor_usage=false
268 Whether to log the usage of the cAdvisor container
269
270
271 --log_dir=""
272 If non-empty, write log files in this directory
273
274
275 --logtostderr=true
276 log to standard error instead of files
277
278
279 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
280 Comma-separated list of files to check for machine-id. Use the
281 first one that exists.
282
283
284 --match-server-version=false
285 Require server version to match client version
286
287
288 -n, --namespace=""
289 If present, the namespace scope for this CLI request
290
291
292 --request-timeout="0"
293 The length of time to wait before giving up on a single server
294 request. Non-zero values should contain a corresponding time unit (e.g.
295 1s, 2m, 3h). A value of zero means don't timeout requests.
296
297
298 -s, --server=""
299 The address and port of the Kubernetes API server
300
301
302 --stderrthreshold=2
303 logs at or above this threshold go to stderr
304
305
306 --storage_driver_buffer_duration=0
307 Writes in the storage driver will be buffered for this duration,
308 and committed to the non memory backends as a single transaction
309
310
311 --storage_driver_db="cadvisor"
312 database name
313
314
315 --storage_driver_host="localhost:8086"
316 database host:port
317
318
319 --storage_driver_password="root"
320 database password
321
322
323 --storage_driver_secure=false
324 use secure connection with database
325
326
327 --storage_driver_table="stats"
328 table name
329
330
331 --storage_driver_user="root"
332 database username
333
334
335 --token=""
336 Bearer token for authentication to the API server
337
338
339 --user=""
340 The name of the kubeconfig user to use
341
342
343 -v, --v=0
344 log level for V logs
345
346
347 --version=false
348 Print version information and quit
349
350
351 --vmodule=
352 comma-separated list of pattern=N settings for file-filtered log‐
353 ging
354
355
356
358 # Delete a pod using the type and ID specified in pod.json.
359 oc delete -f pod.json
360
361 # Delete a pod based on the type and ID in the JSON passed into stdin.
362 cat pod.json | oc delete -f -
363
364 # Delete pods and services with label name=myLabel.
365 oc delete pods,services -l name=myLabel
366
367 # Delete a pod with name node-1-vsjnm.
368 oc delete pod node-1-vsjnm
369
370 # Delete all resources associated with a running app, includes
371 # buildconfig,deploymentconfig,service,imagestream,route and pod,
372 # where 'appName' is listed in 'Labels' of 'oc describe [resource] [resource name]' output.
373 oc delete all -l app=appName
374
375 # Delete all pods
376 oc delete pods --all
377
378
379
380
382 oc(1),
383
384
385
387 June 2016, Ported from the Kubernetes man-doc generator
388
389
390
391Openshift Openshift CLI User Manuals OC(1)