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

NAME

6       oc label - Update the labels on a resource
7
8
9

SYNOPSIS

11       oc label [OPTIONS]
12
13
14

DESCRIPTION

16       Update the labels on one or more resources
17
18
19       A  valid  label value is consisted of letters and/or numbers with a max
20       length of  63 characters. If --overwrite is true, then existing  labels
21       can  be  overwritten,  otherwise  attempting  to overwrite a label will
22       result in an error. If --resource-version is  specified,  then  updates
23       will use this resource version, otherwise the existing resource-version
24       will be used.
25
26
27

OPTIONS

29       --all=false
30           Select all resources, including uninitialized ones, in  the  names‐
31       pace of the specified resource types
32
33
34       --allow-missing-template-keys=true
35           If  true, ignore any errors in templates when a field or map key is
36       missing in the template. Only applies to  golang  and  jsonpath  output
37       formats.
38
39
40       --dry-run=false
41           If  true, only print the object that would be sent, without sending
42       it.
43
44
45       --field-selector=""
46           Selector (field query)  to  filter  on,  supports  '=',  '==',  and
47       '!='.(e.g.  --field-selector  key1=value1,key2=value2). The server only
48       supports a limited number of field queries per type.
49
50
51       -f, --filename=[]
52           Filename, directory, or URL to files identifying  the  resource  to
53       update the labels
54
55
56       --include-uninitialized=false
57           If  true,  the kubectl command applies to uninitialized objects. If
58       explicitly set to false, this flag overrides other flags that make  the
59       kubectl commands apply to uninitialized objects, e.g., "--all". Objects
60       with empty metadata.initializers are regarded as initialized.
61
62
63       --list=false
64           If true, display the labels for a given resource.
65
66
67       --local=false
68           If true, label will NOT contact api-server but run locally.
69
70
71       -o, --output=""
72           Output format. One of:  json|yaml|name|template|go-template|go-tem‐
73       plate-file|templatefile|jsonpath|jsonpath-file.
74
75
76       --overwrite=false
77           If  true,  allow  labels  to be overwritten, otherwise reject label
78       updates that overwrite existing labels.
79
80
81       --record=false
82           Record current kubectl command in the resource annotation.  If  set
83       to  false,  do  not record the command. If set to true, record the com‐
84       mand. If not set, default to updating  the  existing  annotation  value
85       only if one already exists.
86
87
88       -R, --recursive=false
89           Process  the  directory  used in -f, --filename recursively. Useful
90       when you want to manage related manifests  organized  within  the  same
91       directory.
92
93
94       --resource-version=""
95           If  non-empty,  the  labels update will only succeed if this is the
96       current resource-version for the object. Only valid when  specifying  a
97       single resource.
98
99
100       -l, --selector=""
101           Selector  (label  query)  to filter on, not including uninitialized
102       ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2).
103
104
105       --template=""
106           Template string or path to template file  to  use  when  -o=go-tem‐
107       plate,  -o=go-template-file.  The template format is golang templates [
108http://golang.org/pkg/text/template/#pkg-overview⟩].
109
110
111

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

365                # Update pod 'foo' with the label 'unhealthy' and the value 'true'.
366                oc label pods foo unhealthy=true
367
368                # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value.
369                oc label --overwrite pods foo status=unhealthy
370
371                # Update all pods in the namespace
372                oc label pods --all status=unhealthy
373
374                # Update pod 'foo' only if the resource is unchanged from version 1.
375                oc label pods foo status=unhealthy --resource-version=1
376
377                # Update pod 'foo' by removing a label named 'bar' if it exists.
378                # Does not require the --overwrite flag.
379                oc label pods foo bar-
380
381
382
383

SEE ALSO

385       oc(1),
386
387
388

HISTORY

390       June 2016, Ported from the Kubernetes man-doc generator
391
392
393
394Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum