mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
224 lines
9.8 KiB
Plaintext
224 lines
9.8 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * cli_reference/openshift_cli/getting-started.adoc
|
|
// * installing/installing_aws/installing-aws-user-infra.adoc
|
|
// * installing/installing_aws/installing-aws-customizations.adoc
|
|
// * installing/installing_aws/installing-aws-default.adoc
|
|
// * installing/installing_aws/installing-aws-china.adoc
|
|
// * installing/installing_aws/installing-aws-government-region.adoc
|
|
// * installing/installing_aws/installing-aws-secret-region.adoc
|
|
// * installing/installing_aws/installing-aws-private.adoc
|
|
// * installing/installing_aws/installing-aws-vpc.adoc
|
|
// * installing/installing_aws/installing-aws-localzone.adoc
|
|
// * installing/installaing_aws/installing-aws-wavelength-zone.adoc
|
|
// * installing/installing_aws/installing-restricted-networks-aws-installer-provisioned.adoc
|
|
// * installing/installing_aws/installing-aws-outposts-remote-workers.adocs
|
|
// * installing/installing_azure/installing-azure-customizations.adoc
|
|
// * installing/installing_azure/installing-azure-default.adoc
|
|
// * installing/installing_azure/installing-azure-government-region.adoc
|
|
// * installing/installing_azure/installing-azure-private.adoc
|
|
// * installing/installing_azure/installing-azure-vnet.adoc
|
|
// * installing/installing_azure/installing-azure-user-infra.adoc
|
|
// * installing/installing_bare_metal/upi/installing-bare-metal.adoc
|
|
// * installing/installing_gcp/installing-gcp-customizations.adoc
|
|
// * installing/installing_gcp/installing-gcp-private.adoc
|
|
// * installing/installing_gcp/installing-gcp-default.adoc
|
|
// * installing/installing_gcp/installing-gcp-vpc.adoc
|
|
// * installing/installing_gcp/installing-gcp-user-infra.adoc
|
|
// * installing/installing_gcp/installing-restricted-networks-gcp-installer-provisioned.adoc
|
|
// * installing/installing_ibm_cloud/installing-ibm-cloud-customizations.adoc
|
|
// * installing/installing_ibm_cloud/installing-ibm-cloud-vpc.adoc
|
|
// * installing/installing_ibm_cloud/installing-ibm-cloud-private.adoc
|
|
// * installing/installing_ibm_cloud/installing-ibm-cloud-restricted.adoc
|
|
// * installing/install_config/installing-restricted-networks-preparations.adoc
|
|
// * openshift_images/samples-operator-alt-registry.adoc
|
|
// * updating/updating-restricted-network-cluster/mirroring-image-repository.adoc
|
|
// * microshift_cli_ref/microshift-oc-cli-install.adoc
|
|
// * updating/updating_a_cluster/updating_disconnected_cluster/mirroring-image-repository.adoc
|
|
// * installing/installing-nutanix-installer-provisioned.adoc
|
|
// * installing/installing-restricted-networks-nutanix-installer-provisioned.adoc
|
|
// * installing/installing_ibm_powervs/installing-ibm-power-vs-private-cluster.adoc
|
|
// * installing/installing_ibm_powervs/installing-restricted-networks-ibm-power-vs.adoc
|
|
// * installing/installing_ibm_powervs/installing-ibm-powervs-vpc.adoc
|
|
// * installing/installing-restricted-networks-azure-installer-provisioned.adoc
|
|
// * installing/installing_azure/installing-restricted-networks-azure-user-provisioned.adoc
|
|
// * installing/installing_vsphere/ipi/ipi-vsphere-preparing-to-install.adoc
|
|
// * installing/installing_vsphere/upi/upi-vsphere-preparing-to-install.adoc
|
|
// * installing/installing_ibm_z/upi-ibm-z-preparing-to-install.adoc
|
|
// AMQ docs link to this; do not change anchor
|
|
|
|
ifeval::["{context}" == "mirroring-ocp-image-repository"]
|
|
:restricted:
|
|
endif::[]
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="cli-installing-cli_{context}"]
|
|
= Installing the OpenShift CLI
|
|
|
|
You can install the {oc-first} to interact with {product-title} from a command-line interface. You can install `oc` on Linux, Windows, or macOS.
|
|
|
|
[IMPORTANT]
|
|
====
|
|
If you installed an earlier version of `oc`, you cannot use it to complete all of the commands in {product-title}.
|
|
|
|
Download and install the new version of `oc`.
|
|
ifdef::restricted[]
|
|
If you are updating a cluster in a disconnected environment, install the `oc` version that you plan to update to.
|
|
endif::restricted[]
|
|
====
|
|
|
|
|
|
== Installing the OpenShift CLI on Linux
|
|
|
|
You can install the OpenShift CLI (`oc`) binary on Linux by using the following procedure.
|
|
|
|
ifdef::microshift[]
|
|
[NOTE]
|
|
====
|
|
{product-title} version numbering matches {OCP} version numbering. Use the `oc` binary that matches your {microshift-short} version and has the appropriate RHEL compatibility.
|
|
====
|
|
|
|
endif::microshift[]
|
|
.Procedure
|
|
|
|
ifdef::openshift-origin[]
|
|
. Navigate to link:https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/[https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/] and choose the folder for your operating system and architecture.
|
|
. Download `oc.tar.gz`.
|
|
endif::[]
|
|
ifndef::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {product-title}] page on the Red{nbsp}Hat Customer Portal.
|
|
. Select the architecture from the *Product Variant* list.
|
|
. Select the appropriate version from the *Version* list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} Linux Clients* entry and save the file.
|
|
endif::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
ifdef::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {OCP}] page on the Red{nbsp}Hat Customer Portal.
|
|
. Select the architecture from the *Product Variant* list.
|
|
. Select the appropriate version from the *Version* list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} Linux Clients* entry and save the file.
|
|
endif::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Unpack the archive:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ tar xvf <file>
|
|
----
|
|
. Place the `oc` binary in a directory that is on your `PATH`.
|
|
+
|
|
To check your `PATH`, execute the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ echo $PATH
|
|
----
|
|
|
|
.Verification
|
|
|
|
* After you install the OpenShift CLI, it is available using the `oc` command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc <command>
|
|
----
|
|
|
|
|
|
== Installing the OpenShift CLI on Windows
|
|
|
|
You can install the OpenShift CLI (`oc`) binary on Windows by using the following procedure.
|
|
ifdef::microshift[]
|
|
[NOTE]
|
|
====
|
|
{product-title} version numbering matches {OCP} version numbering. Use the `oc` binary that matches your {microshift-short} version and has the appropriate RHEL compatibility.
|
|
====
|
|
|
|
endif::microshift[]
|
|
.Procedure
|
|
|
|
ifdef::openshift-origin[]
|
|
. Navigate to link:https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/[https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/] and choose the folder for your operating system and architecture.
|
|
. Download `oc.zip`.
|
|
endif::[]
|
|
ifndef::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {product-title}] page on the Red{nbsp}Hat Customer Portal.
|
|
. Select the appropriate version from the *Version* list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} Windows Client* entry and save the file.
|
|
endif::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
ifdef::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {OCP}] page on the Red Hat Customer Portal.
|
|
. Select the appropriate version from the *Version* list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} Windows Client* entry and save the file.
|
|
endif::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. 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:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
C:\> path
|
|
----
|
|
|
|
.Verification
|
|
|
|
* After you install the OpenShift CLI, it is available using the `oc` command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
C:\> oc <command>
|
|
----
|
|
|
|
|
|
== Installing the OpenShift CLI on macOS
|
|
|
|
You can install the OpenShift CLI (`oc`) binary on macOS by using the following procedure.
|
|
ifdef::microshift[]
|
|
[NOTE]
|
|
====
|
|
{product-title} version numbering matches {OCP} version numbering. Use the `oc` binary that matches your {microshift-short} version and has the appropriate RHEL compatibility.
|
|
====
|
|
|
|
endif::microshift[]
|
|
.Procedure
|
|
|
|
ifdef::openshift-origin[]
|
|
. Navigate to link:https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/[https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/] and choose the folder for your operating system and architecture.
|
|
. Download `oc.tar.gz`.
|
|
endif::[]
|
|
ifndef::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {product-title}] page on the Red{nbsp}Hat Customer Portal.
|
|
. Select the appropriate version from the *Version* drop-down list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} macOS Clients* entry and save the file.
|
|
+
|
|
[NOTE]
|
|
====
|
|
For macOS arm64, choose the *OpenShift v{product-version} macOS arm64 Client* entry.
|
|
====
|
|
endif::openshift-origin,microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
ifdef::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. Navigate to the link:https://access.redhat.com/downloads/content/290[Download {OCP}] on the Red{nbsp}Hat Customer Portal.
|
|
. Select the appropriate version from the *Version* drop-down list.
|
|
. Click *Download Now* next to the *OpenShift v{product-version} macOS Clients* entry and save the file.
|
|
endif::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
. 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:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ echo $PATH
|
|
----
|
|
|
|
.Verification
|
|
|
|
* Verify your installation by using an `oc` command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc <command>
|
|
----
|
|
|
|
ifeval::["{context}" == "mirroring-ocp-image-repository"]
|
|
:!restricted:
|
|
endif::[]
|