1OC(1)                              June 2016                             OC(1)
2
3
4

NAME

6       oc apply - Apply a configuration to a resource by filename or stdin
7
8
9

SYNOPSIS

11       oc apply [OPTIONS]
12
13
14

DESCRIPTION

16       Apply a configuration to a resource by filename or stdin.
17
18
19       JSON and YAML formats are accepted.
20
21
22

OPTIONS

24       --all=false
25           Select  all  resources  in  the namespace of the specified resource
26       types.
27
28
29       --allow-missing-template-keys=true
30           If true, ignore any errors in templates when a field or map key  is
31       missing  in  the  template.  Only applies to golang and jsonpath output
32       formats.
33
34
35       --cascade=true
36           If true, cascade the deletion of  the  resources  managed  by  this
37       resource (e.g. Pods created by a ReplicationController).  Default true.
38
39
40       --dry-run=false
41           If  true, only print the object that would be sent, without sending
42       it.
43
44
45       -f, --filename=[]
46           that contains the configuration to apply
47
48
49       --force=false
50           Only  used  when  grace-period=0.  If  true,   immediately   remove
51       resources  from  API  and bypass graceful deletion. Note that immediate
52       deletion of some resources may result in inconsistency or data loss and
53       requires confirmation.
54
55
56       --grace-period=-1
57           Period of time in seconds given to the resource to terminate grace‐
58       fully. Ignored if negative. Set to 1 for immediate shutdown.  Can  only
59       be set to 0 when --force is true (force deletion).
60
61
62       --include-uninitialized=false
63           If  true,  the kubectl command applies to uninitialized objects. If
64       explicitly set to false, this flag overrides other flags that make  the
65       kubectl commands apply to uninitialized objects, e.g., "--all". Objects
66       with empty metadata.initializers are regarded as initialized.
67
68
69       --openapi-patch=true
70           If true, use openapi to calculate diff when  the  openapi  presents
71       and the resource can be found in the openapi spec. Otherwise, fall back
72       to use baked-in types.
73
74
75       -o, --output=""
76           Output format. One of: json|yaml|name|templatefile|template|go-tem‐
77       plate|go-template-file|jsonpath-file|jsonpath.
78
79
80       --overwrite=true
81           Automatically  resolve conflicts between the modified and live con‐
82       figuration by using values from the modified configuration
83
84
85       --prune=false
86           Automatically delete resource objects, including the  uninitialized
87       ones, that do not appear in the configs and are created by either apply
88       or create --save-config. Should be used with either -l or --all.
89
90
91       --prune-whitelist=[]
92           Overwrite  the  default  whitelist  with  <group/version/kind>  for
93       --prune
94
95
96       --record=false
97           Record  current  kubectl command in the resource annotation. If set
98       to false, do not record the command. If set to true,  record  the  com‐
99       mand.  If  not  set,  default to updating the existing annotation value
100       only if one already exists.
101
102
103       -R, --recursive=false
104           Process the directory used in -f,  --filename  recursively.  Useful
105       when  you  want  to  manage related manifests organized within the same
106       directory.
107
108
109       -l, --selector=""
110           Selector (label query)  to  filter  on,  supports  '=',  '==',  and
111       '!='.(e.g. -l key1=value1,key2=value2)
112
113
114       --template=""
115           Template  string  or  path  to template file to use when -o=go-tem‐
116       plate, -o=go-template-file. The template format is golang  templates  [
117http://golang.org/pkg/text/template/#pkg-overview⟩].
118
119
120       --timeout=0
121           The length of time to wait before giving up on a delete, zero means
122       determine a timeout from the size of the object
123
124
125       --validate=false
126           If true, use a schema to validate the input before sending it
127
128
129       --wait=false
130           If true, wait for resources to be gone before returning. This waits
131       for finalizers.
132
133
134

OPTIONS INHERITED FROM PARENT COMMANDS

136       --allow_verification_with_non_compliant_keys=false
137           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
138       non-compliant with RFC6962.
139
140
141       --alsologtostderr=false
142           log to standard error as well as files
143
144
145       --application_metrics_count_limit=100
146           Max number of application metrics to store (per container)
147
148
149       --as=""
150           Username to impersonate for the operation
151
152
153       --as-group=[]
154           Group to impersonate for the operation, this flag can  be  repeated
155       to specify multiple groups.
156
157
158       --azure-container-registry-config=""
159           Path  to the file containing Azure container registry configuration
160       information.
161
162
163       --boot_id_file="/proc/sys/kernel/random/boot_id"
164           Comma-separated list of files to check for boot-id. Use  the  first
165       one that exists.
166
167
168       --cache-dir="/builddir/.kube/http-cache"
169           Default HTTP cache directory
170
171
172       --certificate-authority=""
173           Path to a cert file for the certificate authority
174
175
176       --client-certificate=""
177           Path to a client certificate file for TLS
178
179
180       --client-key=""
181           Path to a client key file for TLS
182
183
184       --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
185           CIDRs opened in GCE firewall for LB traffic proxy  health checks
186
187
188       --cluster=""
189           The name of the kubeconfig cluster to use
190
191
192       --container_hints="/etc/cadvisor/container_hints.json"
193           location of the container hints file
194
195
196       --containerd="unix:///var/run/containerd.sock"
197           containerd endpoint
198
199
200       --context=""
201           The name of the kubeconfig context to use
202
203
204       --default-not-ready-toleration-seconds=300
205           Indicates   the   tolerationSeconds   of   the    toleration    for
206       notReady:NoExecute  that is added by default to every pod that does not
207       already have such a toleration.
208
209
210       --default-unreachable-toleration-seconds=300
211           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
212       able:NoExecute  that  is  added  by  default to every pod that does not
213       already have such a toleration.
214
215
216       --docker="unix:///var/run/docker.sock"
217           docker endpoint
218
219
220       --docker-tls=false
221           use TLS to connect to docker
222
223
224       --docker-tls-ca="ca.pem"
225           path to trusted CA
226
227
228       --docker-tls-cert="cert.pem"
229           path to client certificate
230
231
232       --docker-tls-key="key.pem"
233           path to private key
234
235
236       --docker_env_metadata_whitelist=""
237           a comma-separated list of environment variable keys that  needs  to
238       be collected for docker containers
239
240
241       --docker_only=false
242           Only report docker containers in addition to root stats
243
244
245       --docker_root="/var/lib/docker"
246           DEPRECATED:  docker  root is read from docker info (this is a fall‐
247       back, default: /var/lib/docker)
248
249
250       --enable_load_reader=false
251           Whether to enable cpu load reader
252
253
254       --event_storage_age_limit="default=24h"
255           Max length of time for which to store events (per type). Value is a
256       comma  separated  list  of  key  values, where the keys are event types
257       (e.g.: creation, oom) or "default" and the value is a duration. Default
258       is applied to all non-specified event types
259
260
261       --event_storage_event_limit="default=100000"
262           Max  number  of  events to store (per type). Value is a comma sepa‐
263       rated list of key values, where the keys are event  types  (e.g.:  cre‐
264       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
265       applied to all non-specified event types
266
267
268       --global_housekeeping_interval=0
269           Interval between global housekeepings
270
271
272       --housekeeping_interval=0
273           Interval between container housekeepings
274
275
276       --httptest.serve=""
277           if non-empty, httptest.NewServer serves on this address and blocks
278
279
280       --insecure-skip-tls-verify=false
281           If true, the server's certificate will not be checked for validity.
282       This will make your HTTPS connections insecure
283
284
285       --kubeconfig=""
286           Path to the kubeconfig file to use for CLI requests.
287
288
289       --log-flush-frequency=0
290           Maximum number of seconds between log flushes
291
292
293       --log_backtrace_at=:0
294           when logging hits line file:N, emit a stack trace
295
296
297       --log_cadvisor_usage=false
298           Whether to log the usage of the cAdvisor container
299
300
301       --log_dir=""
302           If non-empty, write log files in this directory
303
304
305       --logtostderr=true
306           log to standard error instead of files
307
308
309       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
310           Comma-separated  list  of  files  to  check for machine-id. Use the
311       first one that exists.
312
313
314       --match-server-version=false
315           Require server version to match client version
316
317
318       -n, --namespace=""
319           If present, the namespace scope for this CLI request
320
321
322       --request-timeout="0"
323           The length of time to wait before giving  up  on  a  single  server
324       request. Non-zero values should contain a corresponding time unit (e.g.
325       1s, 2m, 3h). A value of zero means don't timeout requests.
326
327
328       -s, --server=""
329           The address and port of the Kubernetes API server
330
331
332       --stderrthreshold=2
333           logs at or above this threshold go to stderr
334
335
336       --storage_driver_buffer_duration=0
337           Writes in the storage driver will be buffered  for  this  duration,
338       and committed to the non memory backends as a single transaction
339
340
341       --storage_driver_db="cadvisor"
342           database name
343
344
345       --storage_driver_host="localhost:8086"
346           database host:port
347
348
349       --storage_driver_password="root"
350           database password
351
352
353       --storage_driver_secure=false
354           use secure connection with database
355
356
357       --storage_driver_table="stats"
358           table name
359
360
361       --storage_driver_user="root"
362           database username
363
364
365       --token=""
366           Bearer token for authentication to the API server
367
368
369       --user=""
370           The name of the kubeconfig user to use
371
372
373       -v, --v=0
374           log level for V logs
375
376
377       --version=false
378           Print version information and quit
379
380
381       --vmodule=
382           comma-separated  list  of pattern=N settings for file-filtered log‐
383       ging
384
385
386

EXAMPLE

388                # Apply the configuration in pod.json to a pod.
389                oc apply -f ./pod.json
390
391                # Apply the JSON passed into stdin to a pod.
392                cat pod.json | oc apply -f -
393
394
395
396

SEE ALSO

398       oc(1),   oc-apply-edit-last-applied(1),   oc-apply-set-last-applied(1),
399       oc-apply-view-last-applied(1),
400
401
402

HISTORY

404       June 2016, Ported from the Kubernetes man-doc generator
405
406
407
408Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum