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

NAME

6       oc set volumes - Update volumes on a pod template
7
8
9

SYNOPSIS

11       oc set volumes [OPTIONS]
12
13
14

DESCRIPTION

16       Update volumes on a pod template
17
18
19       This  command can add, update or remove volumes from containers for any
20       object that has a pod template (deployment  configs,  replication  con‐
21       trollers,  or pods). You can list volumes in pod or any object that has
22       a pod template. You can specify a single object or multiple, and  alter
23       volumes on all containers or just those that match a given name.
24
25
26       If you alter a volume setting on a deployment config, a deployment will
27       be triggered. Changing a replication controller will not affect running
28       pods, and you cannot change a pod's volumes once it has been created.
29
30
31       Volume types include:
32
33              ·  emptydir  (empty  directory)  default : A directory allocated
34              when the pod is created on a local host, is removed when the pod
35              is deleted and is not copied across servers
36
37              ·  hostdir  (host  directory): A directory with specific path on
38              any host (requires elevated privileges)
39
40              · persistentvolumeclaim or pvc (persistent volume  claim):  Link
41              the  volume  directory  in  the container to a persistent volume
42              claim you have allocated by name - a persistent volume claim  is
43              a  request  to  allocate storage. Note that if your claim hasn't
44              been bound, your pods will not start.
45
46              · secret (mounted secret): Secret volumes mount a  named  secret
47              to the provided directory.
48
49       For   descriptions  on  other  volume  types,  see  ⟨https://docs.open
50       shift.com⟩
51
52
53

OPTIONS

55       --add=false
56           If true, add volume and/or volume mounts for containers
57
58
59       --all=false
60           If true, select all resources in the  namespace  of  the  specified
61       resource types
62
63
64       --allow-missing-template-keys=true
65           If  true, ignore any errors in templates when a field or map key is
66       missing in the template. Only applies to  golang  and  jsonpath  output
67       formats.
68
69
70       --claim-class=""
71           StorageClass to use for the persistent volume claim
72
73
74       --claim-mode="ReadWriteOnce"
75           Set  the  access  mode of the claim to be created. Valid values are
76       ReadWriteOnce (rwo), ReadWriteMany (rwm), or ReadOnlyMany (rom)
77
78
79       --claim-name=""
80           Persistent volume claim name. Must be provided  for  persistentVol‐
81       umeClaim volume type
82
83
84       --claim-size=""
85           If  specified  along  with  a  persistent volume type, create a new
86       claim with the given size in bytes. Accepts SI notation: 10, 10G, 10Gi
87
88
89       --configmap-name=""
90           Name of the persisted config map. Must be  provided  for  configmap
91       volume type
92
93
94       --confirm=false
95           If true, confirm that you really want to remove multiple volumes
96
97
98       -c, --containers="*"
99           The  names  of containers in the selected pod templates to change -
100       may use wildcards
101
102
103       --default-mode=""
104           The default mode bits to create files with. Can be between 0000 and
105       0777. Defaults to 0644.
106
107
108       --dry-run=false
109           If  true, only print the object that would be sent, without sending
110       it.
111
112
113       -f, --filename=[]
114           Filename, directory, or URL to files to use to edit the resource
115
116
117       --local=false
118           If true, set image will NOT contact api-server but run locally.
119
120
121       -m, --mount-path=""
122           Mount path inside  the  container.  Optional  param  for  --add  or
123       --remove
124
125
126       --name=""
127           Name of the volume. If empty, auto generated for add operation
128
129
130       -o, --output=""
131           Output  format. One of: json|yaml|name|template|go-template|go-tem‐
132       plate-file|templatefile|jsonpath|jsonpath-file.
133
134
135       --overwrite=false
136           If true, replace existing volume  source  with  the  provided  name
137       and/or volume mount for the given resource
138
139
140       --path=""
141           Host path. Must be provided for hostPath volume type
142
143
144       --read-only=false
145           Mount volume as ReadOnly. Optional param for --add or --remove
146
147
148       -R, --recursive=false
149           Process  the  directory  used in -f, --filename recursively. Useful
150       when you want to manage related manifests  organized  within  the  same
151       directory.
152
153
154       --remove=false
155           If true, remove volume and/or volume mounts for containers
156
157
158       --secret-name=""
159           Name  of  the  persisted secret. Must be provided for secret volume
160       type
161
162
163       -l, --selector=""
164           Selector (label query) to filter on
165
166
167       --source=""
168           Details of volume source as json string. This can be  used  if  the
169       required  volume  type  is  not  supported  by  --type  option.  (e.g.:
170       '{"gitRepo": {"repository": <git-url>, "revision": <commit-hash>}}')
171
172
173       --sub-path=""
174           Path within the local volume  from  which  the  container's  volume
175       should be mounted. Optional param for --add or --remove
176
177
178       --template=""
179           Template  string  or  path  to template file to use when -o=go-tem‐
180       plate, -o=go-template-file. The template format is golang  templates  [
181http://golang.org/pkg/text/template/#pkg-overview⟩].
182
183
184       -t, --type=""
185           Type  of  the  volume  source for add operation. Supported options:
186       emptyDir, hostPath, secret, configmap, persistentVolumeClaim
187
188
189

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

443                # List volumes defined on all deployment configs in the current project
444                oc set volume dc --all
445
446                # Add a new empty dir volume to deployment config (dc) 'registry' mounted under
447                # /var/lib/registry
448                oc set volume dc/registry --add --mount-path=/var/lib/registry
449
450                # Use an existing persistent volume claim (pvc) to overwrite an existing volume 'v1'
451                oc set volume dc/registry --add --name=v1 -t pvc --claim-name=pvc1 --overwrite
452
453                # Remove volume 'v1' from deployment config 'registry'
454                oc set volume dc/registry --remove --name=v1
455
456                # Create a new persistent volume claim that overwrites an existing volume 'v1'
457                oc set volume dc/registry --add --name=v1 -t pvc --claim-size=1G --overwrite
458
459                # Change the mount point for volume 'v1' to /data
460                oc set volume dc/registry --add --name=v1 -m /data --overwrite
461
462                # Modify the deployment config by removing volume mount "v1" from container "c1"
463                # (and by removing the volume "v1" if no other containers have volume mounts that reference it)
464                oc set volume dc/registry --remove --name=v1 --containers=c1
465
466                # Add new volume based on a more complex volume source (Git repo, AWS EBS, GCE PD,
467                # Ceph, Gluster, NFS, ISCSI, ...)
468                oc set volume dc/registry --add -m /repo --source=<json-string>
469
470
471
472

SEE ALSO

474       oc-set(1),
475
476
477

HISTORY

479       June 2016, Ported from the Kubernetes man-doc generator
480
481
482
483Openshift                  Openshift CLI User Manuals                OC SET(1)
Impressum