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|template|go-template|go-tem‐
77       plate-file|templatefile|jsonpath|jsonpath-file.
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       --insecure-skip-tls-verify=false
277           If true, the server's certificate will not be checked for validity.
278       This will make your HTTPS connections insecure
279
280
281       --kubeconfig=""
282           Path to the kubeconfig file to use for CLI requests.
283
284
285       --log-flush-frequency=0
286           Maximum number of seconds between log flushes
287
288
289       --log_backtrace_at=:0
290           when logging hits line file:N, emit a stack trace
291
292
293       --log_cadvisor_usage=false
294           Whether to log the usage of the cAdvisor container
295
296
297       --log_dir=""
298           If non-empty, write log files in this directory
299
300
301       --logtostderr=true
302           log to standard error instead of files
303
304
305       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
306           Comma-separated  list  of  files  to  check for machine-id. Use the
307       first one that exists.
308
309
310       --match-server-version=false
311           Require server version to match client version
312
313
314       -n, --namespace=""
315           If present, the namespace scope for this CLI request
316
317
318       --request-timeout="0"
319           The length of time to wait before giving  up  on  a  single  server
320       request. Non-zero values should contain a corresponding time unit (e.g.
321       1s, 2m, 3h). A value of zero means don't timeout requests.
322
323
324       -s, --server=""
325           The address and port of the Kubernetes API server
326
327
328       --stderrthreshold=2
329           logs at or above this threshold go to stderr
330
331
332       --storage_driver_buffer_duration=0
333           Writes in the storage driver will be buffered  for  this  duration,
334       and committed to the non memory backends as a single transaction
335
336
337       --storage_driver_db="cadvisor"
338           database name
339
340
341       --storage_driver_host="localhost:8086"
342           database host:port
343
344
345       --storage_driver_password="root"
346           database password
347
348
349       --storage_driver_secure=false
350           use secure connection with database
351
352
353       --storage_driver_table="stats"
354           table name
355
356
357       --storage_driver_user="root"
358           database username
359
360
361       --token=""
362           Bearer token for authentication to the API server
363
364
365       --user=""
366           The name of the kubeconfig user to use
367
368
369       -v, --v=0
370           log level for V logs
371
372
373       --version=false
374           Print version information and quit
375
376
377       --vmodule=
378           comma-separated  list  of pattern=N settings for file-filtered log‐
379       ging
380
381
382

EXAMPLE

384                # Apply the configuration in pod.json to a pod.
385                oc apply -f ./pod.json
386
387                # Apply the JSON passed into stdin to a pod.
388                cat pod.json | oc apply -f -
389
390
391
392

SEE ALSO

394       oc(1),   oc-apply-edit-last-applied(1),   oc-apply-set-last-applied(1),
395       oc-apply-view-last-applied(1),
396
397
398

HISTORY

400       June 2016, Ported from the Kubernetes man-doc generator
401
402
403
404Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum