This is a cache of https://docs.openshift.com/dedicated/cli_reference/openshift_cli/usage-oc-kubectl.html. It is a snapshot of the page at 2024-11-23T05:13:23.079+0000.
Usage of oc and kubectl commands - OpenShift <strong>cli</strong> (oc) | <strong>cli</strong> tools | OpenShift Dedicated
×

The Kubernetes command-line interface (cli), kubectl, can be used to run commands against a Kubernetes cluster. Because OpenShift Dedicated is a certified Kubernetes distribution, you can use the supported kubectl binaries that ship with OpenShift Dedicated , or you can gain extended functionality by using the oc binary.

The oc binary

The oc binary offers the same capabilities as the kubectl binary, but it extends to natively support additional OpenShift Dedicated features, including:

  • Full support for OpenShift Dedicated resources

    Resources such as DeploymentConfig, BuildConfig, Route, ImageStream, and ImageStreamTag objects are specific to OpenShift Dedicated distributions, and build upon standard Kubernetes primitives.

  • Authentication

  • Additional commands

    The additional command oc new-app, for example, makes it easier to get new applications started using existing source code or pre-built images. Similarly, the additional command oc new-project makes it easier to start a project that you can switch to as your default.

If you installed an earlier version of the oc binary, you cannot use it to complete all of the commands in OpenShift Dedicated . If you want the latest features, you must download and install the latest version of the oc binary corresponding to your OpenShift Dedicated server version.

Non-security API changes will involve, at minimum, two minor releases (4.1 to 4.2 to 4.3, for example) to allow older oc binaries to update. Using new capabilities might require newer oc binaries. A 4.3 server might have additional capabilities that a 4.2 oc binary cannot use and a 4.3 oc binary might have additional capabilities that are unsupported by a 4.2 server.

Table 1. Compatibility Matrix

X.Y (oc client)

X.Y+N [1] (oc client)

X.Y (Server)

redcircle 1

redcircle 3

X.Y+N [1] (Server)

redcircle 2

redcircle 1

redcircle 1 Fully compatible.

redcircle 2 oc client might not be able to access server features.

redcircle 3 oc client might provide options and features that might not be compatible with the accessed server.

The kubectl binary

The kubectl binary is provided as a means to support existing workflows and scripts for new OpenShift Dedicated users coming from a standard Kubernetes environment, or for those who prefer to use the kubectl cli. Existing users of kubectl can continue to use the binary to interact with Kubernetes primitives, with no changes required to the OpenShift Dedicated cluster.

You can install the supported kubectl binary by following the steps to Install the OpenShift cli. The kubectl binary is included in the archive if you download the binary, or is installed when you install the cli by using an RPM.

For more information, see the kubectl documentation.


1. Where N is a number greater than or equal to 1.