Oc: Difference between revisions
Line 15: | Line 15: | ||
=Installation= | =Installation= | ||
RHEL: <tt>oc</tt> can be installed with the <tt>atomic-openshift-clients</tt> package. | RHEL: <tt>oc</tt> can be installed with the <tt>atomic-openshift-clients</tt> package. Once installed, it can be added to PATH as follows: | ||
Mac: Download from https://access.redhat.com/downloads/content/290, choose "OpenShift v3.5 MacOSX Client". Then extract the content and place "oc" in PATH. | Mac: Download from https://access.redhat.com/downloads/content/290, choose "OpenShift v3.5 MacOSX Client". Then extract the content and place "oc" in PATH. |
Revision as of 18:42, 30 July 2017
External
- https://docs.openshift.com/container-platform/latest/cli_reference/basic_cli_operations.html
- https://docs.openshift.com/container-platform/latest/cli_reference/admin_cli_operations.html
Internal
Overview
oc is the OpenShift remote client that talks with the master API server. Intended for regular users. The cluster administrator's CLI interface is oadm.
Installation
RHEL: oc can be installed with the atomic-openshift-clients package. Once installed, it can be added to PATH as follows:
Mac: Download from https://access.redhat.com/downloads/content/290, choose "OpenShift v3.5 MacOSX Client". Then extract the content and place "oc" in PATH.
Namespace Selection
By default, oc selects objects from the current project.
To specify another project, use
oc -n <project-name> ...
Output
In general, all oc commands can be configured to send their output in either JSON or YAML format, rather than execute the command.
This is achieved with
oc ... -o json|yaml
In case of oc get, the output of the server execution is rendered in JSON/YAML if -o json|-o yaml is used.
Logging and Debugging
oc ... --loglevel=8
This log level shows the API requests made with each command.
The curl commands used to send the requests are displayed with:
oc --v=10 ...