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