1OC SET(1) June 2016 OC SET(1)
2
3
4
6 oc set env - Update environment variables on a pod template
7
8
9
11 oc set env [OPTIONS]
12
13
14
16 Update environment variables on a pod template or a build config
17
18
19 List environment variable definitions in one or more pods, pod tem‐
20 plates or build configuration. Add, update, or remove container envi‐
21 ronment variable definitions in one or more pod templates (within
22 replication controllers or deployment configurations) or build configu‐
23 rations. View or modify the environment variable definitions on all
24 containers in the specified pods or pod templates, or just those that
25 match a wildcard.
26
27
28 If "--env -" is passed, environment variables can be read from STDIN
29 using the standard env syntax.
30
31
32
34 --all=false
35 If true, select all resources in the namespace of the specified
36 resource types
37
38
39 --allow-missing-template-keys=true
40 If true, ignore any errors in templates when a field or map key is
41 missing in the template. Only applies to golang and jsonpath output
42 formats.
43
44
45 -c, --containers="*"
46 The names of containers in the selected pod templates to change -
47 may use wildcards
48
49
50 --dry-run=false
51 If true, only print the object that would be sent, without sending
52 it.
53
54
55 -e, --env=[]
56 Specify a key-value pair for an environment variable to set into
57 each container.
58
59
60 -f, --filename=[]
61 Filename, directory, or URL to files to use to edit the resource
62
63
64 --from=""
65 The name of a resource from which to inject environment variables
66
67
68 --list=false
69 If true, display the environment and any changes in the standard
70 format
71
72
73 --local=false
74 If true, set image will NOT contact api-server but run locally.
75
76
77 -o, --output=""
78 Output format. One of: json|yaml|name|templatefile|template|go-tem‐
79 plate|go-template-file|jsonpath|jsonpath-file.
80
81
82 --overwrite=true
83 If true, allow environment to be overwritten, otherwise reject
84 updates that overwrite existing environment.
85
86
87 --prefix=""
88 Prefix to append to variable names
89
90
91 -R, --recursive=false
92 Process the directory used in -f, --filename recursively. Useful
93 when you want to manage related manifests organized within the same
94 directory.
95
96
97 --resolve=false
98 If true, show secret or configmap references when listing variables
99
100
101 --resource-version=""
102 If non-empty, the labels update will only succeed if this is the
103 current resource-version for the object. Only valid when specifying a
104 single resource.
105
106
107 -l, --selector=""
108 Selector (label query) to filter on
109
110
111 --template=""
112 Template string or path to template file to use when -o=go-tem‐
113 plate, -o=go-template-file. The template format is golang templates [
114 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
115
116
117
119 --allow_verification_with_non_compliant_keys=false
120 Allow a SignatureVerifier to use keys which are technically
121 non-compliant with RFC6962.
122
123
124 --alsologtostderr=false
125 log to standard error as well as files
126
127
128 --application_metrics_count_limit=100
129 Max number of application metrics to store (per container)
130
131
132 --as=""
133 Username to impersonate for the operation
134
135
136 --as-group=[]
137 Group to impersonate for the operation, this flag can be repeated
138 to specify multiple groups.
139
140
141 --azure-container-registry-config=""
142 Path to the file containing Azure container registry configuration
143 information.
144
145
146 --boot_id_file="/proc/sys/kernel/random/boot_id"
147 Comma-separated list of files to check for boot-id. Use the first
148 one that exists.
149
150
151 --cache-dir="/builddir/.kube/http-cache"
152 Default HTTP cache directory
153
154
155 --certificate-authority=""
156 Path to a cert file for the certificate authority
157
158
159 --client-certificate=""
160 Path to a client certificate file for TLS
161
162
163 --client-key=""
164 Path to a client key file for TLS
165
166
167 --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
168 CIDRs opened in GCE firewall for LB traffic proxy health checks
169
170
171 --cluster=""
172 The name of the kubeconfig cluster to use
173
174
175 --container_hints="/etc/cadvisor/container_hints.json"
176 location of the container hints file
177
178
179 --containerd="unix:///var/run/containerd.sock"
180 containerd endpoint
181
182
183 --context=""
184 The name of the kubeconfig context to use
185
186
187 --default-not-ready-toleration-seconds=300
188 Indicates the tolerationSeconds of the toleration for
189 notReady:NoExecute that is added by default to every pod that does not
190 already have such a toleration.
191
192
193 --default-unreachable-toleration-seconds=300
194 Indicates the tolerationSeconds of the toleration for unreach‐
195 able:NoExecute that is added by default to every pod that does not
196 already have such a toleration.
197
198
199 --docker="unix:///var/run/docker.sock"
200 docker endpoint
201
202
203 --docker-tls=false
204 use TLS to connect to docker
205
206
207 --docker-tls-ca="ca.pem"
208 path to trusted CA
209
210
211 --docker-tls-cert="cert.pem"
212 path to client certificate
213
214
215 --docker-tls-key="key.pem"
216 path to private key
217
218
219 --docker_env_metadata_whitelist=""
220 a comma-separated list of environment variable keys that needs to
221 be collected for docker containers
222
223
224 --docker_only=false
225 Only report docker containers in addition to root stats
226
227
228 --docker_root="/var/lib/docker"
229 DEPRECATED: docker root is read from docker info (this is a fall‐
230 back, default: /var/lib/docker)
231
232
233 --enable_load_reader=false
234 Whether to enable cpu load reader
235
236
237 --event_storage_age_limit="default=24h"
238 Max length of time for which to store events (per type). Value is a
239 comma separated list of key values, where the keys are event types
240 (e.g.: creation, oom) or "default" and the value is a duration. Default
241 is applied to all non-specified event types
242
243
244 --event_storage_event_limit="default=100000"
245 Max number of events to store (per type). Value is a comma sepa‐
246 rated list of key values, where the keys are event types (e.g.: cre‐
247 ation, oom) or "default" and the value is an integer. Default is
248 applied to all non-specified event types
249
250
251 --global_housekeeping_interval=0
252 Interval between global housekeepings
253
254
255 --housekeeping_interval=0
256 Interval between container housekeepings
257
258
259 --httptest.serve=""
260 if non-empty, httptest.NewServer serves on this address and blocks
261
262
263 --insecure-skip-tls-verify=false
264 If true, the server's certificate will not be checked for validity.
265 This will make your HTTPS connections insecure
266
267
268 --kubeconfig=""
269 Path to the kubeconfig file to use for CLI requests.
270
271
272 --log-flush-frequency=0
273 Maximum number of seconds between log flushes
274
275
276 --log_backtrace_at=:0
277 when logging hits line file:N, emit a stack trace
278
279
280 --log_cadvisor_usage=false
281 Whether to log the usage of the cAdvisor container
282
283
284 --log_dir=""
285 If non-empty, write log files in this directory
286
287
288 --logtostderr=true
289 log to standard error instead of files
290
291
292 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
293 Comma-separated list of files to check for machine-id. Use the
294 first one that exists.
295
296
297 --match-server-version=false
298 Require server version to match client version
299
300
301 -n, --namespace=""
302 If present, the namespace scope for this CLI request
303
304
305 --request-timeout="0"
306 The length of time to wait before giving up on a single server
307 request. Non-zero values should contain a corresponding time unit (e.g.
308 1s, 2m, 3h). A value of zero means don't timeout requests.
309
310
311 -s, --server=""
312 The address and port of the Kubernetes API server
313
314
315 --stderrthreshold=2
316 logs at or above this threshold go to stderr
317
318
319 --storage_driver_buffer_duration=0
320 Writes in the storage driver will be buffered for this duration,
321 and committed to the non memory backends as a single transaction
322
323
324 --storage_driver_db="cadvisor"
325 database name
326
327
328 --storage_driver_host="localhost:8086"
329 database host:port
330
331
332 --storage_driver_password="root"
333 database password
334
335
336 --storage_driver_secure=false
337 use secure connection with database
338
339
340 --storage_driver_table="stats"
341 table name
342
343
344 --storage_driver_user="root"
345 database username
346
347
348 --token=""
349 Bearer token for authentication to the API server
350
351
352 --user=""
353 The name of the kubeconfig user to use
354
355
356 -v, --v=0
357 log level for V logs
358
359
360 --version=false
361 Print version information and quit
362
363
364 --vmodule=
365 comma-separated list of pattern=N settings for file-filtered log‐
366 ging
367
368
369
371 # Update deployment 'registry' with a new environment variable
372 oc set env dc/registry STORAGE_DIR=/local
373
374 # List the environment variables defined on a build config 'sample-build'
375 oc set env bc/sample-build --list
376
377 # List the environment variables defined on all pods
378 oc set env pods --all --list
379
380 # Output modified build config in YAML
381 oc set env bc/sample-build STORAGE_DIR=/data -o yaml
382
383 # Update all containers in all replication controllers in the project to have ENV=prod
384 oc set env rc --all ENV=prod
385
386 # Import environment from a secret
387 oc set env --from=secret/mysecret dc/myapp
388
389 # Import environment from a config map with a prefix
390 oc set env --from=configmap/myconfigmap --prefix=MYSQL_ dc/myapp
391
392 # Remove the environment variable ENV from container 'c1' in all deployment configs
393 oc set env dc --all --containers="c1" ENV-
394
395 # Remove the environment variable ENV from a deployment config definition on disk and
396 # update the deployment config on the server
397 oc set env -f dc.json ENV-
398
399 # Set some of the local shell environment into a deployment config on the server
400 env | grep RAILS_ | oc set env -e - dc/registry
401
402
403
404
406 oc-set(1),
407
408
409
411 June 2016, Ported from the Kubernetes man-doc generator
412
413
414
415Openshift Openshift CLI User Manuals OC SET(1)