此内容没有您所选择的语言版本。

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 MicroShift is a certified Kubernetes distribution, you can use the supported kubectl CLI tool or you can gain extended functionality by using the OpenShift CLI (oc).

5.1. The kubectl CLI tool

You can use the kubectl CLI tool to interact with Kubernetes primitives on your MicroShift node. You can also use existing kubectl workflows and scripts for users coming from another Kubernetes environment, or for those who prefer to use the kubectl CLI.

5.2. The oc CLI tool

The oc CLI tool offers the same capabilities as the kubectl CLI tool, but it extends to natively support additional OpenShift Container Platform features, including:

  • Route resource

    The Route resource object is specific to OpenShift Container Platform 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 oc, you might not be able use it to complete all of the commands in MicroShift 4.20. If you want the latest features, you must download and install the latest version of oc that corresponds with your MicroShift version.

Using new capabilities often requires the latest oc binary. A 4.20 server might have additional capabilities that a 4.16 oc binary cannot use and a 4.20 oc binary might have additional capabilities that are unsupported by a 4.15 server.

Expand
Table 5.1. Compatibility Matrix
 

X.Y (oc Client)

X.Y+N [a] (oc Client)

X.Y (Server)

Fully compatible.

The oc CLI tool might provide options and features that are not compatible with the accessed server.

X.Y+N [a] (Server)

The oc CLI tool might not be able to access server features.

Fully compatible.

[a] Where N is a number greater than or equal to 1.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat