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

NAME

6       oc get - Display one or many resources
7
8
9

SYNOPSIS

11       oc get [OPTIONS]
12
13
14

DESCRIPTION

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

OPTIONS

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 [
132http://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

OPTIONS INHERITED FROM PARENT COMMANDS

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       --httptest.serve=""
293           if non-empty, httptest.NewServer serves on this address and blocks
294
295
296       --insecure-skip-tls-verify=false
297           If true, the server's certificate will not be checked for validity.
298       This will make your HTTPS connections insecure
299
300
301       --kubeconfig=""
302           Path to the kubeconfig file to use for CLI requests.
303
304
305       --log-flush-frequency=0
306           Maximum number of seconds between log flushes
307
308
309       --log_backtrace_at=:0
310           when logging hits line file:N, emit a stack trace
311
312
313       --log_cadvisor_usage=false
314           Whether to log the usage of the cAdvisor container
315
316
317       --log_dir=""
318           If non-empty, write log files in this directory
319
320
321       --logtostderr=true
322           log to standard error instead of files
323
324
325       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
326           Comma-separated  list  of  files  to  check for machine-id. Use the
327       first one that exists.
328
329
330       --match-server-version=false
331           Require server version to match client version
332
333
334       -n, --namespace=""
335           If present, the namespace scope for this CLI request
336
337
338       --request-timeout="0"
339           The length of time to wait before giving  up  on  a  single  server
340       request. Non-zero values should contain a corresponding time unit (e.g.
341       1s, 2m, 3h). A value of zero means don't timeout requests.
342
343
344       -s, --server=""
345           The address and port of the Kubernetes API server
346
347
348       --stderrthreshold=2
349           logs at or above this threshold go to stderr
350
351
352       --storage_driver_buffer_duration=0
353           Writes in the storage driver will be buffered  for  this  duration,
354       and committed to the non memory backends as a single transaction
355
356
357       --storage_driver_db="cadvisor"
358           database name
359
360
361       --storage_driver_host="localhost:8086"
362           database host:port
363
364
365       --storage_driver_password="root"
366           database password
367
368
369       --storage_driver_secure=false
370           use secure connection with database
371
372
373       --storage_driver_table="stats"
374           table name
375
376
377       --storage_driver_user="root"
378           database username
379
380
381       --token=""
382           Bearer token for authentication to the API server
383
384
385       --user=""
386           The name of the kubeconfig user to use
387
388
389       -v, --v=0
390           log level for V logs
391
392
393       --version=false
394           Print version information and quit
395
396
397       --vmodule=
398           comma-separated  list  of pattern=N settings for file-filtered log‐
399       ging
400
401
402

EXAMPLE

404                # List all pods in ps output format.
405                oc get pods
406
407                # List a single replication controller with specified ID in ps output format.
408                oc get rc redis
409
410                # List all pods and show more details about them.
411                oc get -o wide pods
412
413                # List a single pod in JSON output format.
414                oc get -o json pod redis-pod
415
416                # Return only the status value of the specified pod.
417                oc get -o template pod redis-pod --template={{.currentState.status}}
418
419
420
421

SEE ALSO

423       oc(1),
424
425
426

HISTORY

428       June 2016, Ported from the Kubernetes man-doc generator
429
430
431
432Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum