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|go-template-file|template‐
79 file|template|go-template|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 --insecure-skip-tls-verify=false
260 If true, the server's certificate will not be checked for validity.
261 This will make your HTTPS connections insecure
262
263
264 --kubeconfig=""
265 Path to the kubeconfig file to use for CLI requests.
266
267
268 --log-flush-frequency=0
269 Maximum number of seconds between log flushes
270
271
272 --log_backtrace_at=:0
273 when logging hits line file:N, emit a stack trace
274
275
276 --log_cadvisor_usage=false
277 Whether to log the usage of the cAdvisor container
278
279
280 --log_dir=""
281 If non-empty, write log files in this directory
282
283
284 --logtostderr=true
285 log to standard error instead of files
286
287
288 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
289 Comma-separated list of files to check for machine-id. Use the
290 first one that exists.
291
292
293 --match-server-version=false
294 Require server version to match client version
295
296
297 -n, --namespace=""
298 If present, the namespace scope for this CLI request
299
300
301 --request-timeout="0"
302 The length of time to wait before giving up on a single server
303 request. Non-zero values should contain a corresponding time unit (e.g.
304 1s, 2m, 3h). A value of zero means don't timeout requests.
305
306
307 -s, --server=""
308 The address and port of the Kubernetes API server
309
310
311 --stderrthreshold=2
312 logs at or above this threshold go to stderr
313
314
315 --storage_driver_buffer_duration=0
316 Writes in the storage driver will be buffered for this duration,
317 and committed to the non memory backends as a single transaction
318
319
320 --storage_driver_db="cadvisor"
321 database name
322
323
324 --storage_driver_host="localhost:8086"
325 database host:port
326
327
328 --storage_driver_password="root"
329 database password
330
331
332 --storage_driver_secure=false
333 use secure connection with database
334
335
336 --storage_driver_table="stats"
337 table name
338
339
340 --storage_driver_user="root"
341 database username
342
343
344 --token=""
345 Bearer token for authentication to the API server
346
347
348 --user=""
349 The name of the kubeconfig user to use
350
351
352 -v, --v=0
353 log level for V logs
354
355
356 --version=false
357 Print version information and quit
358
359
360 --vmodule=
361 comma-separated list of pattern=N settings for file-filtered log‐
362 ging
363
364
365
367 # Update deployment 'registry' with a new environment variable
368 oc set env dc/registry STORAGE_DIR=/local
369
370 # List the environment variables defined on a build config 'sample-build'
371 oc set env bc/sample-build --list
372
373 # List the environment variables defined on all pods
374 oc set env pods --all --list
375
376 # Output modified build config in YAML
377 oc set env bc/sample-build STORAGE_DIR=/data -o yaml
378
379 # Update all containers in all replication controllers in the project to have ENV=prod
380 oc set env rc --all ENV=prod
381
382 # Import environment from a secret
383 oc set env --from=secret/mysecret dc/myapp
384
385 # Import environment from a config map with a prefix
386 oc set env --from=configmap/myconfigmap --prefix=MYSQL_ dc/myapp
387
388 # Remove the environment variable ENV from container 'c1' in all deployment configs
389 oc set env dc --all --containers="c1" ENV-
390
391 # Remove the environment variable ENV from a deployment config definition on disk and
392 # update the deployment config on the server
393 oc set env -f dc.json ENV-
394
395 # Set some of the local shell environment into a deployment config on the server
396 env | grep RAILS_ | oc set env -e - dc/registry
397
398
399
400
402 oc-set(1),
403
404
405
407 June 2016, Ported from the Kubernetes man-doc generator
408
409
410
411Openshift Openshift CLI User Manuals OC SET(1)