Chapter 5. Using oc and kubectl commands


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

5.1. The oc binary

The oc binary offers the same capabilities as the kubectl binary, but it extends to natively support additional Red Hat build of MicroShift features, including:

  • Route resource

    The Route resource object is specific to Red Hat build of MicroShift distributions, and builds upon standard Kubernetes primitives.

  • 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.

Important

If you installed an earlier version of the oc binary, you cannot use it to complete all of the commands in Red Hat build of MicroShift 4.12. If you want the latest features, you must download and install the latest version of the oc binary corresponding to your Red Hat build of MicroShift 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 5.1. Compatibility Matrix
 

X.Y (oc Client)

X.Y+N footnote:versionpolicyn[Where N is a number greater than or equal to 1.] (oc Client)

X.Y (Server)

redcircle 1

redcircle 3

X.Y+N footnote:versionpolicyn[] (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.

5.2. The kubectl binary

The kubectl binary is provided as a means to support existing workflows and scripts for new Red Hat build of MicroShift 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 Red Hat build of MicroShift cluster.

The kubectl binary is included in the archive if you download the oc binary.

For more information, see the kubectl documentation.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.