- Red Hat Customer Portal
- Log in to Your Red Hat Account
- Red Hat Account
- Customer Portal
- Select Your Language
- Chapter 1. OpenShift CLI (oc)
- 1.1. Getting started with the CLI
- 1.1.1. About the CLI
- 1.1.2. Installing the CLI
- 1.1.2.1. Installing the CLI on Linux
- 1.1.2.2. Installing the CLI on Windows
- 1.1.2.3. Installing the CLI on macOS
- 1.1.3. Logging in to the CLI
- 1.1.4. Using the CLI
- 1.1.4.1. Creating a project
- 1.1.4.2. Creating a new app
- 1.1.4.3. Viewing pods
- 1.1.4.4. Viewing pod logs
- 1.1.4.5. Viewing the current project
- 1.1.4.6. Viewing the status for the current project
- 1.1.4.7. Listing supported API resources
- 1.1.5. Getting help
- 1.1.6. Logging out of the CLI
- 1.2. Configuring the CLI
- 1.2.1. Enabling tab completion
- 1.3. Extending the CLI with plug-ins
- 1.3.1. Writing CLI plug-ins
- 1.3.2. Installing and using CLI plug-ins
- 1.4. Developer CLI commands
- 1.4.1. Basic CLI commands
- 1.4.1.1. explain
- 1.4.1.2. login
- 1.4.1.3. new-app
- 1.4.1.4. new-project
- 1.4.1.5. project
- 1.4.1.6. projects
- 1.4.1.7. status
- 1.4.2. Build and Deploy CLI commands
- 1.4.2.1. cancel-build
- 1.4.2.2. import-image
- 1.4.2.3. new-build
- 1.4.2.4. rollback
- 1.4.2.5. rollout
- 1.4.2.6. start-build
- 1.4.2.7. tag
- 1.4.3. Application management CLI commands
- 1.4.3.1. annotate
- 1.4.3.2. apply
- 1.4.3.3. autoscale
- 1.4.3.4. create
- 1.4.3.5. delete
- 1.4.3.6. describe
- 1.4.3.7. edit
- 1.4.3.8. expose
- 1.4.3.9. get
- 1.4.3.10. label
- 1.4.3.11. scale
- 1.4.3.12. secrets
- 1.4.3.13. serviceaccounts
- 1.4.3.14. set
- 1.4.4. Troubleshooting and debugging CLI commands
- 1.4.4.1. attach
- 1.4.4.2. cp
- 1.4.4.3. debug
- 1.4.4.4. exec
- 1.4.4.5. logs
- 1.4.4.6. port-forward
- 1.4.4.7. proxy
- 1.4.4.8. rsh
- 1.4.4.9. rsync
- 1.4.4.10. run
- 1.4.4.11. wait
- 1.4.5. Advanced developer CLI commands
- 1.4.5.1. api-resources
- 1.4.5.2. api-versions
- 1.4.5.3. auth
- 1.4.5.4. cluster-info
- 1.4.5.5. convert
- 1.4.5.6. extract
- 1.4.5.7. idle
- 1.4.5.8. image
- 1.4.5.9. observe
- 1.4.5.10. patch
- 1.4.5.11. policy
- 1.4.5.12. process
- 1.4.5.13. registry
- 1.4.5.14. replace
- 1.4.6. Settings CLI commands
- 1.4.6.1. completion
- 1.4.6.2. config
- 1.4.6.3. logout
- 1.4.6.4. whoami
- 1.4.7. Other developer CLI commands
- 1.4.7.1. help
- 1.4.7.2. plugin
- 1.4.7.3. version
- 1.5. Administrator CLI commands
- 1.5.1. Cluster management CLI commands
- 1.5.1.1. must-gather
- 1.5.1.2. top
- 1.5.2. Node management CLI commands
- 1.5.2.1. cordon
- 1.5.2.2. drain
- 1.5.2.3. node-logs
- 1.5.2.4. taint
- 1.5.2.5. uncordon
- 1.5.3. Security and policy CLI commands
- 1.5.3.1. certificate
- 1.5.3.2. groups
- 1.5.3.3. new-project
- 1.5.3.4. pod-network
- 1.5.3.5. policy
- 1.5.4. Maintenance CLI commands
- 1.5.4.1. migrate
- 1.5.4.2. prune
- 1.5.5. Configuration CLI commands
- 1.5.5.1. create-api-client-config
- 1.5.5.2. create-bootstrap-policy-file
- 1.5.5.3. create-bootstrap-project-template
- 1.5.5.4. create-error-template
- 1.5.5.5. create-kubeconfig
- 1.5.5.6. create-login-template
- 1.5.5.7. create-provider-selection-template
- 1.5.6. Other Administrator CLI commands
- 1.5.6.1. build-chain
- 1.5.6.2. completion
- 1.5.6.3. config
- 1.5.6.4. release
- 1.5.6.5. verify-image-signature
- 1.6. Usage of oc and kubectl commands
- 1.6.1. The oc binary
- 1.6.2. The kubectl binary
Red Hat Customer Portal
Log in to Your Red Hat Account
Your Red Hat account gives you access to your profile, preferences, and services, depending on your status.
If you are a new customer, register now for access to product evaluations and purchasing capabilities.
Need access to an account?
If your company has an existing Red Hat account, your organization administrator can grant you access.
Red Hat Account
Customer Portal
For your security, if you’re on a public computer and have finished using your Red Hat services, please be sure to log out.
Select Your Language
Chapter 1. OpenShift CLI (oc)
1.1. Getting started with the CLI
1.1.1. About the CLI
With the OpenShift Container Platform command-line interface (CLI), you can create applications and manage OpenShift Container Platform projects from a terminal. The CLI is ideal in situations where you:
- Work directly with project source code.
- Script OpenShift Container Platform operations.
- Are restricted by bandwidth resources and can not use the web console.
1.1.2. Installing the CLI
You can install the OpenShift CLI ( oc ) in order to interact with OpenShift Container Platform from a command-line interface. You can install oc on Linux, Windows, or macOS.
If you installed an earlier version of oc , you cannot use it to complete all of the commands in OpenShift Container Platform 4.2. Download and install the new version of oc .
1.1.2.1. Installing the CLI on Linux
You can install the OpenShift CLI ( oc ) binary on Linux by using the following procedure.
Procedure
- Navigate to the Infrastructure Provider page on the Red Hat OpenShift Cluster Manager site.
- Select your infrastructure provider, and, if applicable, your installation type.
- In the Command-line interface section, select Linux from the drop-down menu and click Download command-line tools .
Unpack the archive:
Place the oc binary in a directory that is on your PATH .
To check your PATH , execute the following command:
After you install the CLI, it is available using the oc command:
1.1.2.2. Installing the CLI on Windows
You can install the OpenShift CLI ( oc ) binary on Windows by using the following procedure.
Procedure
- Navigate to the Infrastructure Provider page on the Red Hat OpenShift Cluster Manager site.
- Select your infrastructure provider, and, if applicable, your installation type.
- In the Command-line interface section, select Windows from the drop-down menu and click Download command-line tools .
- Unzip the archive with a ZIP program.
Move the oc binary to a directory that is on your PATH .
To check your PATH , open the command prompt and execute the following command:
After you install the CLI, it is available using the oc command:
1.1.2.3. Installing the CLI on macOS
You can install the OpenShift CLI ( oc ) binary on macOS by using the following procedure.
Procedure
- Navigate to the Infrastructure Provider page on the Red Hat OpenShift Cluster Manager site.
- Select your infrastructure provider, and, if applicable, your installation type.
- In the Command-line interface section, select MacOS from the drop-down menu and click Download command-line tools .
- Unpack and unzip the archive.
Move the oc binary to a directory on your PATH.
To check your PATH , open a terminal and execute the following command:
After you install the CLI, it is available using the oc command:
1.1.3. Logging in to the CLI
You can log in to the oc CLI to access and manage your cluster.
Prerequisites
- You must have access to an OpenShift Container Platform cluster.
- You must have installed the CLI.
Procedure
Log in to the CLI using the oc login command and enter the required information when prompted.
You can now create a project or issue other commands for managing your cluster.
1.1.4. Using the CLI
Review the following sections to learn how to complete common tasks using the CLI.
1.1.4.1. Creating a project
Use the oc new-project command to create a new project.
1.1.4.2. Creating a new app
Use the oc new-app command to create a new application.
1.1.4.3. Viewing pods
Use the oc get pods command to view the pods for the current project.
1.1.4.4. Viewing pod logs
Use the oc logs command to view logs for a particular pod.
1.1.4.5. Viewing the current project
Use the oc project command to view the current project.
1.1.4.6. Viewing the status for the current project
Use the oc status command to view information about the current project, such as Services, DeploymentConfigs, and BuildConfigs.
1.1.4.7. Listing supported API resources
Use the oc api-resources command to view the list of supported API resources on the server.
1.1.5. Getting help
You can get help with CLI commands and OpenShift Container Platform resources in the following ways.
Use oc help to get a list and description of all available CLI commands:
Example: Get general help for the CLI
Use the —help flag to get help about a specific CLI command:
Example: Get help for the oc create command
Use the oc explain command to view the description and fields for a particular resource:
Example: View documentation for the Pod resource
1.1.6. Logging out of the CLI
You can log out the CLI to end your current session.
Use the oc logout command.
This deletes the saved authentication token from the server and removes it from your configuration file.
1.2. Configuring the CLI
1.2.1. Enabling tab completion
After you install the oc CLI tool, you can enable tab completion to automatically complete oc commands or suggest options when you press Tab.
Prerequisites
- You must have the oc CLI tool installed.
Procedure
The following procedure enables tab completion for Bash.
Save the Bash completion code to a file.
Copy the file to /etc/bash_completion.d/ .
You can also save the file to a local directory and source it from your .bashrc file instead.
Tab completion is enabled when you open a new terminal.
1.3. Extending the CLI with plug-ins
You can write and install plug-ins to build on the default oc commands, allowing you to perform new and more complex tasks with the OpenShift Container Platform CLI.
1.3.1. Writing CLI plug-ins
You can write a plug-in for the OpenShift Container Platform CLI in any programming language or script that allows you to write command-line commands. Note that you can not use a plug-in to overwrite an existing oc command.
OpenShift CLI plug-ins are currently a Technology Preview feature. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
Procedure
This procedure creates a simple Bash plug-in that prints a message to the terminal when the oc foo command is issued.
Create a file called oc-foo .
When naming your plug-in file, keep the following in mind:
- The file must begin with oc- or kubectl- in order to be recognized as a plug-in.
- The file name determines the command that invokes the plug-in. For example, a plug-in with the file name oc-foo-bar can be invoked by a command of oc foo bar . You can also use underscores if you want the command to contain dashes. For example, a plug-in with the file name oc-foo_bar can be invoked by a command of oc foo-bar .
Add the following contents to the file.
After you install this plug-in for the OpenShift Container Platform CLI, it can be invoked using the oc foo command.
Additional resources
- Review the Sample plug-in repository for an example of a plug-in written in Go.
- Review the CLI runtime repository for a set of utilities to assist in writing plug-ins in Go.
1.3.2. Installing and using CLI plug-ins
After you write a custom plug-in for the OpenShift Container Platform CLI, you must install it to use the functionality that it provides.
OpenShift CLI plug-ins are currently a Technology Preview feature. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
Prerequisites
- You must have the oc CLI tool installed.
- You must have a CLI plug-in file that begins with oc- or kubectl- .
Procedure
If necessary, update the plug-in file to be executable.
Place the file anywhere in your PATH , such as /usr/local/bin/ .
Run oc plugin list to make sure that the plug-in is listed.
If your plug-in is not listed here, verify that the file begins with oc- or kubectl- , is executable, and is on your PATH .
Invoke the new command or option introduced by the plug-in.
For example, if you built and installed the kubectl-ns plug-in from the Sample plug-in repository, you can use the following command to view the current namespace.
Note that the command to invoke the plug-in depends on the plug-in file name. For example, a plug-in with the file name of oc-foo-bar is invoked by the oc foo bar command.
1.4. Developer CLI commands
1.4.1. Basic CLI commands
1.4.1.1. explain
Display documentation for a certain resource.
Example: Display documentation for Pods
1.4.1.2. login
Log in to the OpenShift Container Platform server and save login information for subsequent use.
Example: Interactive login
Example: Log in specifying a user name
1.4.1.3. new-app
Create a new application by specifying source code, a template, or an image.
Example: Create a new application from a local Git repository
Example: Create a new application from a remote Git repository
Example: Create a new application from a private remote repository
1.4.1.4. new-project
Create a new project and switch to it as the default project in your configuration.
Example: Create a new project
1.4.1.5. project
Switch to another project and make it the default in your configuration.
Example: Switch to a different project
1.4.1.6. projects
Display information about the current active project and existing projects on the server.
Example: List all projects
1.4.1.7. status
Show a high-level overview of the current project.
Example: Show the status of the current project
1.4.2. Build and Deploy CLI commands
1.4.2.1. cancel-build
Cancel a running, pending, or new build.
Example: Cancel a build
Example: Cancel all pending builds from the python BuildConfig
1.4.2.2. import-image
Import the latest tag and image information from an image repository.
Example: Import the latest image information
1.4.2.3. new-build
Create a new BuildConfig from source code.
Example: Create a BuildConfig from a local Git repository
Example: Create a BuildConfig from a remote Git repository
1.4.2.4. rollback
Revert an application back to a previous Deployment.
Example: Roll back to the last successful Deployment
Example: Roll back to a specific version
1.4.2.5. rollout
Start a new rollout, view its status or history, or roll back to a previous revision of your application.
Example: Roll back to the last successful Deployment
Example: Start a new rollout for a DeploymentConfig with its latest state
1.4.2.6. start-build
Start a build from a BuildConfig or copy an existing build.
Example: Start a build from the specified BuildConfig
Example: Start a build from a previous build
Example: Set an environment variable to use for the current build
1.4.2.7. tag
Tag existing images into imagestreams.
Example: Configure the ruby image’s latest tag to refer to the image for the 2.0 tag
1.4.3. Application management CLI commands
1.4.3.1. annotate
Update the annotations on one or more resources.
Example: Add an annotation to a Route
Example: Remove the annotation from the Route
1.4.3.2. apply
Apply a configuration to a resource by file name or standard in (stdin) in JSON or YAML format.
Example: Apply the configuration in pod.json to a Pod
1.4.3.3. autoscale
Autoscale a DeploymentConfig or ReplicationController.
Example: Autoscale to a minimum of two and maximum of five Pods
1.4.3.4. create
Create a resource by file name or standard in (stdin) in JSON or YAML format.
Example: Create a Pod using the content in pod.json
1.4.3.5. delete
Delete a resource.
Example: Delete a Pod named parksmap-katacoda-1-qfqz4
Example: Delete all Pods with the app=parksmap-katacoda label
1.4.3.6. describe
Return detailed information about a specific object.
Example: Describe a Deployment named example
Example: Describe all Pods
1.4.3.7. edit
Edit a resource.
Example: Edit a DeploymentConfig using the default editor
Example: Edit a DeploymentConfig using a different editor
Example: Edit a DeploymentConfig in JSON format
1.4.3.8. expose
Expose a Service externally as a Route.
Example: Expose a Service
Example: Expose a Service and specify the host name
1.4.3.9. get
Display one or more resources.
Example: List Pods in the default namespace
Example: Get details about the python DeploymentConfig in JSON format
1.4.3.10. label
Update the labels on one or more resources.
Example: Update the python-1-mz2rf Pod with the label status set to unhealthy
1.4.3.11. scale
Set the desired number of replicas for a ReplicationController or a DeploymentConfig.
Example: Scale the ruby-app DeploymentConfig to three Pods
1.4.3.12. secrets
Manage secrets in your project.
Example: Allow my-pull-secret to be used as an image pull secret by the default service account
1.4.3.13. serviceaccounts
Get a token assigned to a service account or create a new token or kubeconfig file for a service account.
Example: Get the token assigned to the default service account
1.4.3.14. set
Configure existing application resources.
Example: Sets the name of a secret on a BuildConfig
1.4.4. Troubleshooting and debugging CLI commands
1.4.4.1. attach
Attach the shell to a running container.
Example: Get output from the python container from Pod python-1-mz2rf
1.4.4.2. cp
Copy files and directories to and from containers.
Example: Copy a file from the python-1-mz2rf Pod to the local file system
1.4.4.3. debug
Launch a command shell to debug a running application.
Example: Debug the python Deployment
1.4.4.4. exec
Execute a command in a container.
Example: Execute the ls command in the python container from Pod python-1-mz2rf
1.4.4.5. logs
Retrieve the log output for a specific build, BuildConfig, DeploymentConfig, or Pod.
Example: Stream the latest logs from the python DeploymentConfig
1.4.4.6. port-forward
Forward one or more local ports to a Pod.
Example: Listen on port 8888 locally and forward to port 5000 in the Pod
1.4.4.7. proxy
Run a proxy to the Kubernetes API server.
Example: Run a proxy to the API server on port 8011 serving static content from ./local/www/
1.4.4.8. rsh
Open a remote shell session to a container.
Example: Open a shell session on the first container in the python-1-mz2rf Pod
1.4.4.9. rsync
Copy contents of a directory to or from a running Pod container. Only changed files are copied using the rsync command from your operating system.
Example: Synchronize files from a local directory with a Pod directory
1.4.4.10. run
Create and run a particular image. By default, this creates a DeploymentConfig to manage the created containers.
Example: Start an instance of the perl image with three replicas
1.4.4.11. wait
Wait for a specific condition on one or more resources.
Example: Wait for the python-1-mz2rf Pod to be deleted
1.4.5. Advanced developer CLI commands
1.4.5.1. api-resources
Display the full list of API resources that the server supports.
Example: List the supported API resources
1.4.5.2. api-versions
Display the full list of API versions that the server supports.
Example: List the supported API versions
1.4.5.3. auth
Inspect permissions and reconcile RBAC roles.
Example: Check whether the current user can read Pod logs
Example: Reconcile RBAC roles and permissions from a file
1.4.5.4. cluster-info
Display the address of the master and cluster services.
Example: Display cluster information
1.4.5.5. convert
Convert a YAML or JSON configuration file to a different API version and print to standard output (stdout).
Example: Convert pod.yaml to the latest version
1.4.5.6. extract
Extract the contents of a ConfigMap or secret. Each key in the ConfigMap or secret is created as a separate file with the name of the key.
Example: Download the contents of the ruby-1-ca ConfigMap to the current directory
Example: Print the contents of the ruby-1-ca ConfigMap to stdout
1.4.5.7. idle
Idle scalable resources. An idled Service will automatically become unidled when it receives traffic or it can be manually unidled using the oc scale command.
Example: Idle the ruby-app Service
1.4.5.8. image
Manage images in your OpenShift Container Platform cluster.
Example: Copy an image to another tag
1.4.5.9. observe
Observe changes to resources and take action on them.
Example: Observe changes to Services
1.4.5.10. patch
Updates one or more fields of an object using strategic merge patch in JSON or YAML format.
Example: Update the spec.unschedulable field for node node1 to true
If you must patch a Custom Resource Definition, you must include the —type merge option in the command.
1.4.5.11. policy
Manage authorization policies.
Example: Add the edit role to user1 for the current project
1.4.5.12. process
Process a template into a list of resources.
Example: Convert template.json to a resource list and pass to oc create
1.4.5.13. registry
Manage the integrated registry on OpenShift Container Platform.
Example: Display information about the integrated registry
1.4.5.14. replace
Modify an existing object based on the contents of the specified configuration file.
Example: Update a Pod using the content in pod.json
1.4.6. Settings CLI commands
1.4.6.1. completion
Output shell completion code for the specified shell.
Example: Display completion code for Bash
1.4.6.2. config
Manage the client configuration files.
Example: Display the current configuration
Example: Switch to a different context
1.4.6.3. logout
Log out of the current session.
Example: End the current session
1.4.6.4. whoami
Display information about the current session.
Example: Display the currently authenticated user
1.4.7. Other developer CLI commands
1.4.7.1. help
Display general help information for the CLI and a list of available commands.
Example: Display available commands
Example: Display the help for the new-project command
1.4.7.2. plugin
List the available plug-ins on the user’s PATH .
Example: List available plug-ins
1.4.7.3. version
Display the oc client and server versions.
Example: Display version information
For cluster administrators, the OpenShift Container Platform server version is also displayed.
1.5. Administrator CLI commands
1.5.1. Cluster management CLI commands
1.5.1.1. must-gather
Bulk collect data about the current state of your cluster to debug issues.
Example: Gather debugging information
1.5.1.2. top
Show usage statistics of resources on the server.
Example: Show CPU and memory usage for Pods
Example: Show usage statistics for images
1.5.2. Node management CLI commands
1.5.2.1. cordon
Mark a node as unschedulable. Manually marking a node as unschedulable blocks any new pods from being scheduled on the node, but does not affect existing pods on the node.
Example: Mark node1 as unschedulable
1.5.2.2. drain
Drain a node in preparation for maintenance.
Example: Drain node1
1.5.2.3. node-logs
Display and filter node logs.
Example: Get logs for NetworkManager
1.5.2.4. taint
Update the taints on one or more nodes.
Example: Add a taint to dedicate a node for a set of users
Example: Remove the taints with key dedicated from node node1
1.5.2.5. uncordon
Mark a node as schedulable.
Example: Mark node1 as schedulable
1.5.3. Security and policy CLI commands
1.5.3.1. certificate
Approve or reject certificate signing requests (CSRs).
Example: Approve a CSR
1.5.3.2. groups
Manage groups in your cluster.
Example: Create a new group
1.5.3.3. new-project
Create a new project and specify administrative options.
Example: Create a new project using a node selector
1.5.3.4. pod-network
Manage Pod networks in the cluster.
Example: Isolate project1 and project2 from other non-global projects
1.5.3.5. policy
Manage roles and policies on the cluster.
Example: Add the edit role to user1 for all projects
Example: Add the privileged security context constraint to a service account
1.5.4. Maintenance CLI commands
1.5.4.1. migrate
Migrate resources on the cluster to a new version or format depending on the subcommand used.
Example: Perform an update of all stored objects
Example: Perform an update of only Pods
1.5.4.2. prune
Remove older versions of resources from the server.
Example: Prune older builds including those whose BuildConfigs no longer exist
1.5.5. Configuration CLI commands
1.5.5.1. create-api-client-config
Create a client configuration for connecting to the server. This creates a folder containing a client certificate, a client key, a server certificate authority, and a kubeconfig file for connecting to the master as the provided user.
Example: Generate a client certificate for a proxy
1.5.5.2. create-bootstrap-policy-file
Create the default bootstrap policy.
Example: Create a file called policy.json with the default bootstrap policy
1.5.5.3. create-bootstrap-project-template
Create a bootstrap project template.
Example: Output a bootstrap project template in YAML format to stdout
1.5.5.4. create-error-template
Create a template for customizing the error page.
Example: Output a template for the error page to stdout
1.5.5.5. create-kubeconfig
Creates a basic .kubeconfig file from client certificates.
Example: Create a .kubeconfig file with the provided client certificates
1.5.5.6. create-login-template
Create a template for customizing the login page.
Example: Output a template for the login page to stdout
1.5.5.7. create-provider-selection-template
Create a template for customizing the provider selection page.
Example: Output a template for the provider selection page to stdout
1.5.6. Other Administrator CLI commands
1.5.6.1. build-chain
Output the inputs and dependencies of any builds.
Example: Output dependencies for the perl imagestream
1.5.6.2. completion
Output shell completion code for the oc adm commands for the specified shell.
Example: Display oc adm completion code for Bash
1.5.6.3. config
Manage the client configuration files. This command has the same behavior as the oc config command.
Example: Display the current configuration
Example: Switch to a different context
1.5.6.4. release
Manage various aspects of the OpenShift Container Platform release process, such as viewing information about a release or inspecting the contents of a release.
Example: Generate a changelog between two releases and save to changelog.md
1.5.6.5. verify-image-signature
Verify the image signature of an image imported to the internal registry using the local public GPG key.
Example: Verify the nodejs image signature
1.6. Usage of oc and kubectl commands
Kubernetes’ command line interface (CLI), kubectl , can be used to run commands against a Kubernetes cluster. Because OpenShift Container Platform is a certified Kubernetes distribution, you can use the supported kubectl binaries that ship with OpenShift Container Platform, or you can gain extended functionality by using the oc binary.
1.6.1. The oc binary
The oc binary offers the same capabilities as the kubectl binary, but it extends to natively support additional OpenShift Container Platform features, including:
Full support for OpenShift Container Platform resources
Resources such as DeploymentConfigs, BuildConfigs, Routes, ImageStreams, and ImageStreamTags are specific to OpenShift Container Platform distributions, and build upon standard Kubernetes primitives.
Authentication
The oc binary offers a built-in login command that allows authentication and enables you to work with OpenShift Container Platform projects, which map Kubernetes namespaces to authenticated users. See Understanding authentication for more information.
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.
1.6.2. The kubectl binary
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, 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 Container Platform cluster.
For more information, see the kubectl docs.
Источник