1OC(1) June 2016 OC(1)
2
3
4
6 oc get - Display one or many resources
7
8
9
11 oc get [OPTIONS]
12
13
14
16 Display one or many resources
17
18
19 Possible resources include builds, buildConfigs, services, pods, etc.
20 To see a list of common resources, use 'oc get'. Some resources may
21 omit advanced details that you can see with '-o wide'. If you want an
22 even more detailed view, use 'oc describe'.
23
24
25
27 --all-namespaces=false
28 If present, list the requested object(s) across all namespaces.
29 Namespace in current context is ignored even if specified with --names‐
30 pace.
31
32
33 --allow-missing-template-keys=true
34 If true, ignore any errors in templates when a field or map key is
35 missing in the template. Only applies to golang and jsonpath output
36 formats.
37
38
39 --chunk-size=500
40 Return large lists in chunks rather than all at once. Pass 0 to
41 disable. This flag is beta and may change in the future.
42
43
44 --export=false
45 If true, use 'export' for the resources. Exported resources are
46 stripped of cluster-specific information.
47
48
49 --field-selector=""
50 Selector (field query) to filter on, supports '=', '==', and
51 '!='.(e.g. --field-selector key1=value1,key2=value2). The server only
52 supports a limited number of field queries per type.
53
54
55 -f, --filename=[]
56 Filename, directory, or URL to files identifying the resource to
57 get from a server.
58
59
60 --ignore-not-found=false
61 If the requested object does not exist the command will return exit
62 code 0.
63
64
65 --include-uninitialized=false
66 If true, the kubectl command applies to uninitialized objects. If
67 explicitly set to false, this flag overrides other flags that make the
68 kubectl commands apply to uninitialized objects, e.g., "--all". Objects
69 with empty metadata.initializers are regarded as initialized.
70
71
72 -L, --label-columns=[]
73 Accepts a comma separated list of labels that are going to be pre‐
74 sented as columns. Names are case-sensitive. You can also use multiple
75 flag options like -L label1 -L label2...
76
77
78 --no-headers=false
79 When using the default or custom-column output format, don't print
80 headers (default print headers).
81
82
83 -o, --output=""
84 Output format. One of: json|yaml|wide|name|custom-columns=...|cus‐
85 tom-columns-file=...|go-template=...|go-template-file=...|json‐
86 path=...|jsonpath-file=... See custom columns [ ⟨http://kuber‐
87 netes.io/docs/user-guide/kubectl-overview/#custom-columns⟩], golang
88 template [ ⟨http://golang.org/pkg/text/template/#pkg-overview⟩] and
89 jsonpath template [ ⟨http://kubernetes.io/docs/user-guide/jsonpath⟩].
90
91
92 --raw=""
93 Raw URI to request from the server. Uses the transport specified
94 by the kubeconfig file.
95
96
97 -R, --recursive=false
98 Process the directory used in -f, --filename recursively. Useful
99 when you want to manage related manifests organized within the same
100 directory.
101
102
103 -l, --selector=""
104 Selector (label query) to filter on, supports '=', '==', and
105 '!='.(e.g. -l key1=value1,key2=value2)
106
107
108 --server-print=true
109 If true, have the server return the appropriate table output. Sup‐
110 ports extension APIs and CRDs.
111
112
113 --show-kind=false
114 If present, list the resource type for the requested object(s).
115
116
117 --show-labels=false
118 When printing, show all labels as the last column (default hide
119 labels column)
120
121
122 --sort-by=""
123 If non-empty, sort list types using this field specification. The
124 field specification is expressed as a JSONPath expression (e.g.
125 '{.metadata.name}'). The field in the API resource specified by this
126 JSONPath expression must be an integer or a string.
127
128
129 --template=""
130 Template string or path to template file to use when -o=go-tem‐
131 plate, -o=go-template-file. The template format is golang templates [
132 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
133
134
135 --use-openapi-print-columns=false
136 If true, use x-kubernetes-print-column metadata (if present) from
137 the OpenAPI schema for displaying a resource.
138
139
140 -w, --watch=false
141 After listing/getting the requested object, watch for changes.
142 Uninitialized objects are excluded if no object name is provided.
143
144
145 --watch-only=false
146 Watch for changes to the requested object(s), without listing/get‐
147 ting first.
148
149
150
152 --allow_verification_with_non_compliant_keys=false
153 Allow a SignatureVerifier to use keys which are technically
154 non-compliant with RFC6962.
155
156
157 --alsologtostderr=false
158 log to standard error as well as files
159
160
161 --application_metrics_count_limit=100
162 Max number of application metrics to store (per container)
163
164
165 --as=""
166 Username to impersonate for the operation
167
168
169 --as-group=[]
170 Group to impersonate for the operation, this flag can be repeated
171 to specify multiple groups.
172
173
174 --azure-container-registry-config=""
175 Path to the file containing Azure container registry configuration
176 information.
177
178
179 --boot_id_file="/proc/sys/kernel/random/boot_id"
180 Comma-separated list of files to check for boot-id. Use the first
181 one that exists.
182
183
184 --cache-dir="/builddir/.kube/http-cache"
185 Default HTTP cache directory
186
187
188 --certificate-authority=""
189 Path to a cert file for the certificate authority
190
191
192 --client-certificate=""
193 Path to a client certificate file for TLS
194
195
196 --client-key=""
197 Path to a client key file for TLS
198
199
200 --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
201 CIDRs opened in GCE firewall for LB traffic proxy health checks
202
203
204 --cluster=""
205 The name of the kubeconfig cluster to use
206
207
208 --container_hints="/etc/cadvisor/container_hints.json"
209 location of the container hints file
210
211
212 --containerd="unix:///var/run/containerd.sock"
213 containerd endpoint
214
215
216 --context=""
217 The name of the kubeconfig context to use
218
219
220 --default-not-ready-toleration-seconds=300
221 Indicates the tolerationSeconds of the toleration for
222 notReady:NoExecute that is added by default to every pod that does not
223 already have such a toleration.
224
225
226 --default-unreachable-toleration-seconds=300
227 Indicates the tolerationSeconds of the toleration for unreach‐
228 able:NoExecute that is added by default to every pod that does not
229 already have such a toleration.
230
231
232 --docker="unix:///var/run/docker.sock"
233 docker endpoint
234
235
236 --docker-tls=false
237 use TLS to connect to docker
238
239
240 --docker-tls-ca="ca.pem"
241 path to trusted CA
242
243
244 --docker-tls-cert="cert.pem"
245 path to client certificate
246
247
248 --docker-tls-key="key.pem"
249 path to private key
250
251
252 --docker_env_metadata_whitelist=""
253 a comma-separated list of environment variable keys that needs to
254 be collected for docker containers
255
256
257 --docker_only=false
258 Only report docker containers in addition to root stats
259
260
261 --docker_root="/var/lib/docker"
262 DEPRECATED: docker root is read from docker info (this is a fall‐
263 back, default: /var/lib/docker)
264
265
266 --enable_load_reader=false
267 Whether to enable cpu load reader
268
269
270 --event_storage_age_limit="default=24h"
271 Max length of time for which to store events (per type). Value is a
272 comma separated list of key values, where the keys are event types
273 (e.g.: creation, oom) or "default" and the value is a duration. Default
274 is applied to all non-specified event types
275
276
277 --event_storage_event_limit="default=100000"
278 Max number of events to store (per type). Value is a comma sepa‐
279 rated list of key values, where the keys are event types (e.g.: cre‐
280 ation, oom) or "default" and the value is an integer. Default is
281 applied to all non-specified event types
282
283
284 --global_housekeeping_interval=0
285 Interval between global housekeepings
286
287
288 --housekeeping_interval=0
289 Interval between container housekeepings
290
291
292 --insecure-skip-tls-verify=false
293 If true, the server's certificate will not be checked for validity.
294 This will make your HTTPS connections insecure
295
296
297 --kubeconfig=""
298 Path to the kubeconfig file to use for CLI requests.
299
300
301 --log-flush-frequency=0
302 Maximum number of seconds between log flushes
303
304
305 --log_backtrace_at=:0
306 when logging hits line file:N, emit a stack trace
307
308
309 --log_cadvisor_usage=false
310 Whether to log the usage of the cAdvisor container
311
312
313 --log_dir=""
314 If non-empty, write log files in this directory
315
316
317 --logtostderr=true
318 log to standard error instead of files
319
320
321 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
322 Comma-separated list of files to check for machine-id. Use the
323 first one that exists.
324
325
326 --match-server-version=false
327 Require server version to match client version
328
329
330 -n, --namespace=""
331 If present, the namespace scope for this CLI request
332
333
334 --request-timeout="0"
335 The length of time to wait before giving up on a single server
336 request. Non-zero values should contain a corresponding time unit (e.g.
337 1s, 2m, 3h). A value of zero means don't timeout requests.
338
339
340 -s, --server=""
341 The address and port of the Kubernetes API server
342
343
344 --stderrthreshold=2
345 logs at or above this threshold go to stderr
346
347
348 --storage_driver_buffer_duration=0
349 Writes in the storage driver will be buffered for this duration,
350 and committed to the non memory backends as a single transaction
351
352
353 --storage_driver_db="cadvisor"
354 database name
355
356
357 --storage_driver_host="localhost:8086"
358 database host:port
359
360
361 --storage_driver_password="root"
362 database password
363
364
365 --storage_driver_secure=false
366 use secure connection with database
367
368
369 --storage_driver_table="stats"
370 table name
371
372
373 --storage_driver_user="root"
374 database username
375
376
377 --token=""
378 Bearer token for authentication to the API server
379
380
381 --user=""
382 The name of the kubeconfig user to use
383
384
385 -v, --v=0
386 log level for V logs
387
388
389 --version=false
390 Print version information and quit
391
392
393 --vmodule=
394 comma-separated list of pattern=N settings for file-filtered log‐
395 ging
396
397
398
400 # List all pods in ps output format.
401 oc get pods
402
403 # List a single replication controller with specified ID in ps output format.
404 oc get rc redis
405
406 # List all pods and show more details about them.
407 oc get -o wide pods
408
409 # List a single pod in JSON output format.
410 oc get -o json pod redis-pod
411
412 # Return only the status value of the specified pod.
413 oc get -o template pod redis-pod --template={{.currentState.status}}
414
415
416
417
419 oc(1),
420
421
422
424 June 2016, Ported from the Kubernetes man-doc generator
425
426
427
428Openshift Openshift CLI User Manuals OC(1)