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 re‐
26 source-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 name‐
36 space 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-file|jsonpath.
75
76
77 --overwrite=false
78 If true, allow annotations to be overwritten, otherwise reject an‐
79 notation 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 di‐
92 rectory.
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 al‐
191 ready 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 ap‐
243 plied 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 --insecure-skip-tls-verify=false
255 If true, the server's certificate will not be checked for validity.
256 This will make your HTTPS connections insecure
257
258
259 --kubeconfig=""
260 Path to the kubeconfig file to use for CLI requests.
261
262
263 --log-flush-frequency=0
264 Maximum number of seconds between log flushes
265
266
267 --log_backtrace_at=:0
268 when logging hits line file:N, emit a stack trace
269
270
271 --log_cadvisor_usage=false
272 Whether to log the usage of the cAdvisor container
273
274
275 --log_dir=""
276 If non-empty, write log files in this directory
277
278
279 --logtostderr=true
280 log to standard error instead of files
281
282
283 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
284 Comma-separated list of files to check for machine-id. Use the
285 first one that exists.
286
287
288 --match-server-version=false
289 Require server version to match client version
290
291
292 -n, --namespace=""
293 If present, the namespace scope for this CLI request
294
295
296 --request-timeout="0"
297 The length of time to wait before giving up on a single server re‐
298 quest. Non-zero values should contain a corresponding time unit (e.g.
299 1s, 2m, 3h). A value of zero means don't timeout requests.
300
301
302 -s, --server=""
303 The address and port of the Kubernetes API server
304
305
306 --stderrthreshold=2
307 logs at or above this threshold go to stderr
308
309
310 --storage_driver_buffer_duration=0
311 Writes in the storage driver will be buffered for this duration,
312 and committed to the non memory backends as a single transaction
313
314
315 --storage_driver_db="cadvisor"
316 database name
317
318
319 --storage_driver_host="localhost:8086"
320 database host:port
321
322
323 --storage_driver_password="root"
324 database password
325
326
327 --storage_driver_secure=false
328 use secure connection with database
329
330
331 --storage_driver_table="stats"
332 table name
333
334
335 --storage_driver_user="root"
336 database username
337
338
339 --token=""
340 Bearer token for authentication to the API server
341
342
343 --user=""
344 The name of the kubeconfig user to use
345
346
347 -v, --v=0
348 log level for V logs
349
350
351 --version=false
352 Print version information and quit
353
354
355 --vmodule=
356 comma-separated list of pattern=N settings for file-filtered log‐
357 ging
358
359
360
362 # Update pod 'foo' with the annotation 'description' and the value 'my frontend'.
363 # If the same annotation is set multiple times, only the last value will be applied
364 oc annotate pods foo description='my frontend'
365
366 # Update pod 'foo' with the annotation 'description' and the value
367 # 'my frontend running nginx', overwriting any existing value.
368 oc annotate --overwrite pods foo description='my frontend running nginx'
369
370 # Update all pods in the namespace
371 oc annotate pods --all description='my frontend running nginx'
372
373 # Update pod 'foo' only if the resource is unchanged from version 1.
374 oc annotate pods foo description='my frontend running nginx' --resource-version=1
375
376 # Update pod 'foo' by removing an annotation named 'description' if it exists.
377 # Does not require the --overwrite flag.
378 oc annotate pods foo description-
379
380
381
382
384 oc(1),
385
386
387
389 June 2016, Ported from the Kubernetes man-doc generator
390
391
392
393Openshift Openshift CLI User Manuals OC(1)