Oc get: Difference between revisions
(→sa) |
(→routes) |
||
Line 218: | Line 218: | ||
oc [-n ''<project-name>''] get rc | oc [-n ''<project-name>''] get rc | ||
==routes== | ==routes, routes== | ||
<span id='routes'></span> | |||
Displays the project's [[OpenShift_Concepts#Route|routes]]. | Displays the project's [[OpenShift_Concepts#Route|routes]]. | ||
oc get routes | |||
oc get routes | |||
==pv== | ==pv== |
Revision as of 18:38, 20 November 2017
External
Internal
Overview
Gets all resources of a certain type or a single resource of a certain type if specified by name.
Namespace Selection
Generic oc namespace selection applies.
Additionally, to specify all projects, use:
oc get --all-namespaces ...
Selectors
Selectors can be applied with the "-l" option:
oc get ... -l 'label_name=label_value'
Output
JSON Output
oc get ... -o json
JSONPath Output
oc get ... -o jsonpath='{.spec.replicas}'
YAML Output
oc get ... -o yaml
-o template
-o template --template '{{.status.podIP}}{{"\n"}}'
Example:
oc get node infranode1 -o template --template '{{.spec.externalID}}{{"\n"}}' infranode1
Other Options
-w
Watch for changes: after listing/getting the requested object, watch for changes.
Subcommands
all
oc [-n <project-name>] get all
Displays DeploymentConfigs, replication controllers, routes, services, and pods for a project:
NAME REVISION DESIRED CURRENT TRIGGERED BY dc/logging-curator 1 1 1 config dc/logging-es-3fs5ghyo 1 1 1 config dc/logging-kibana 1 1 1 config NAME DESIRED CURRENT READY AGE rc/logging-curator-1 1 1 1 25d rc/logging-es-3fs5ghyo-1 1 1 1 25d rc/logging-kibana-1 1 1 1 25d NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD routes/logging-kibana kibana.apps.openshift.novaordis.io logging-kibana <all> reencrypt/Redirect None NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE svc/logging-es 172.30.254.155 <none> 9200/TCP 25d svc/logging-es-cluster 172.30.148.235 <none> 9300/TCP 25d svc/logging-kibana 172.30.123.83 <none> 443/TCP 25d NAME READY STATUS RESTARTS AGE po/logging-curator-1-drmq5 1/1 Running 5532 24d po/logging-es-3fs5ghyo-1-31p0n 1/1 Running 2 24d po/logging-fluentd-3kz30 0/1 MatchNodeSelector 0 24d po/logging-fluentd-d150b 0/1 MatchNodeSelector 0 24d po/logging-fluentd-ktrc8 0/1 MatchNodeSelector 0 24d po/logging-fluentd-kv781 0/1 MatchNodeSelector 0 24d po/logging-fluentd-nl42s 0/1 MatchNodeSelector 0 24d po/logging-fluentd-x1w4r 1/1 Running 2 24d po/logging-fluentd-x2z8x 1/1 Running 2 24d po/logging-kibana-1-d4bw2 2/2 Running 52 24d
bc
Returns the Build Config.
oc get bc
returns all build configs from the current project.
oc get bc my-build-config
returns the specified build config.
builds
Get the builds and their status.
oc get builds
clusternetwork
Information about the network plugin and network status.
See
dc
Lists the DeploymentConfigs of a project:
oc [-n <project-name>] get dc
event
events
Lists events.
oc get events [-n <project-name>]
identity
Returns information about user identity.
oc get identity
namespaces
netnamespaces
node, nodes
Displays all nodes:
oc get nodes [-n <project-name>]
Describes an individual node:
oc get node <node-name>
pod, pods, po
Displays the pods of a project.
oc [-n <project-name>] get pods oc [-n <project-name>] get po oc get pods --all-namespaces
oc get pod <pod-name>
projects
oc get projects
For more details see
project
oc get project <project-name> -o yaml
sa
Returns the service accounts.
oc get sa
Also see
scc
oc get scc
services, svc
Displays the services of a project:
oc [-n <project-name>] get services oc [-n <project-name>] get svc
se
oc get se docker-registry
status
oc get status
quota
For the current project:
oc get quota
For an arbitrary project:
oc get quota -n <project-name>
rc
Lists the replication controllers of a project:
oc [-n <project-name>] get rc
routes, routes
Displays the project's routes.
oc get routes
pv
pvc
users
Returns the regular users on the system. As "system:admin":
oc get users
NAME UID FULL NAME IDENTITIES ovidiu 788f943e-610c-11e7-9dee-525400863964 htpasswd_auth:ovidiu