Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 6. Differences Between oc and kubectl


6.1. Why Use oc Over kubectl?

Kubernetes' command line interface (CLI), kubectl, is used to run commands against any Kubernetes cluster. Because OpenShift Container Platform runs on top of a Kubernetes cluster, a copy of kubectl is also included with oc, OpenShift Container Platform’s command line interface (CLI).

Although there are several similarities between these two clients, this guide’s aim is to clarify the main reasons and scenarios for using one over the other.

6.2. Using oc

The oc binary offers the same capabilities as the kubectl binary, but it is further extended to natively support OpenShift Container Platform features, such as:

Full support for OpenShift resources
Resources such as DeploymentConfigs, BuildConfigs, Routes, ImageStreams, and ImageStreamTags are specific to OpenShift distributions, and not available in standard Kubernetes.
Authentication
The oc binary offers a built-in login command which allows authentication. See developer authentication and configuring authentication for more information.
Additional commands
For example, the additional command new-app makes it easier to get new applications started using existing source code or pre-built images.

6.3. Using kubectl

The kubectl binary is provided as a means to support existing workflows and scripts for new OpenShift Container Platform users coming from a standard Kubernetes environment. Existing users of kubectl can continue to use the binary with no changes to the API, but should consider upgrading to oc in order to gain the added functionality mentioned in the previous section.

Because oc is built on top of kubectl, converting a kubectl binary to oc is as simple as changing the binary’s name from kubectl to oc.

See Get Started with the CLI for installation and setup instructions.

Red Hat logoGithubRedditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

© 2024 Red Hat, Inc.