Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 33 additions & 9 deletions cli_reference/openshift_cli/getting-started-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@
= Getting started with the OpenShift CLI
include::_attributes/common-attributes.adoc[]
include::_attributes/attributes-openshift-dedicated.adoc[]
:context: cli-developer-commands
:context: getting-started-cli

toc::[]

[role="_abstract"]
Install and configure the {oc-first} to manage {product-title} clusters and deploy applications directly from a terminal.

// About the CLI
include::modules/cli-about-cli.adoc[leveloffset=+1]

[id="installing-openshift-cli"]
== Installing the OpenShift CLI
// Installing the OpenShift CLI
include::modules/cli-installing-cli.adoc[leveloffset=+1]

You can install the OpenShift CLI (`oc`) either by downloading the binary or by using an RPM.
// Installing the OpenShift CLI by downloading the binary from the Customer Portal
include::modules/cli-installing-cli-binary.adoc[leveloffset=+2]

// Installing the OpenShift CLI on Linux
include::modules/cli-installing-cli-linux.adoc[leveloffset=+1]
include::modules/cli-installing-cli-linux.adoc[leveloffset=+3]

// Installing the OpenShift CLI on Windows
include::modules/cli-installing-cli-windows.adoc[leveloffset=+1]
include::modules/cli-installing-cli-windows.adoc[leveloffset=+3]

// Installing the OpenShift CLI on macOS
include::modules/cli-installing-cli-macos.adoc[leveloffset=+1]
include::modules/cli-installing-cli-macos.adoc[leveloffset=+3]

// Installing the CLI by using the web console
// Installing the OpenShift CLI by downloading the binary from the web console
include::modules/cli-installing-cli-web-console.adoc[leveloffset=+2]

// Installing the CLI on Linux by using the web console
Expand All @@ -39,7 +43,6 @@ include::modules/cli-installing-cli-web-console-macos.adoc[leveloffset=+3]
ifndef::openshift-origin[]
// Installing the CLI by using an RPM
include::modules/cli-installing-cli-rpm.adoc[leveloffset=+2]

endif::[]

// Installing the CLI by using Homebrew
Expand All @@ -54,6 +57,27 @@ include::modules/cli-logging-in-web.adoc[leveloffset=+1]
// Using the CLI
include::modules/cli-using-cli.adoc[leveloffset=+1]

// Creating a project
include::modules/cli-using-cli-project.adoc[leveloffset=+2]

// Creating a new application
include::modules/cli-using-cli-new-app.adoc[leveloffset=+2]

// Viewing pods
include::modules/cli-using-cli-pods.adoc[leveloffset=+2]

// Viewing pod logs
include::modules/cli-using-cli-pod-logs.adoc[leveloffset=+2]

// Viewing the current project
include::modules/cli-using-cli-current-project.adoc[leveloffset=+2]

// Viewing the status of the current project
include::modules/cli-using-cli-project-status.adoc[leveloffset=+2]

// Listing supported API resources
include::modules/cli-using-cli-list-api-resources.adoc[leveloffset=+2]

// Getting help
include::modules/cli-getting-help.adoc[leveloffset=+1]

Expand Down
84 changes: 15 additions & 69 deletions cli_reference/openshift_cli/usage-oc-kubectl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,24 @@
include::_attributes/common-attributes.adoc[]
:context: usage-oc-kubectl

The Kubernetes command-line interface (CLI), `kubectl`, can be used to run commands against a Kubernetes cluster. Because {product-title} is a certified Kubernetes distribution, you can use the supported `kubectl` binaries that ship with
{product-title}, or you can gain extended functionality by using the `oc` binary.
[role="_abstract"]
Because {product-title} is a certified Kubernetes distribution, you can use the Kubernetes CLI (`kubectl`) that ships with {product-title} to interact with your cluster. You can also gain extended functionality specific to {product-title} by using the {oc-first} binary.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 [error] RedHat.TermsErrors: Use 'includes' rather than 'ships with'. For more information, see RedHat.TermsErrors.


== The oc binary
// The oc binary
include::modules/oc-usage-oc.adoc[leveloffset=+1]

The `oc` binary offers the same capabilities as the `kubectl` binary, but it extends to natively support additional
{product-title} features, including:
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
[role="_additional-resources"]
.Additional resources

* **Full support for {product-title} resources**
+
Resources such as `DeploymentConfig`, `BuildConfig`, `Route`, `ImageStream`, and `ImageStreamTag` objects are specific to
{product-title}
distributions, and build upon standard Kubernetes primitives.
+
* **Authentication**
+
ifndef::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
The `oc` binary offers a built-in `login` command for authentication and lets you work with projects, which map Kubernetes namespaces to authenticated users.
Read xref:../../authentication/understanding-authentication.adoc#understanding-authentication[Understanding authentication] for more information.
endif::microshift,openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
+
ifdef::microshift[]
The `oc` binary offers a built-in `login` command for authentication to {product-title}.
endif::[]
+
* **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.
* xref:../../authentication/understanding-authentication.adoc#understanding-authentication[Understanding authentication]
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]

[IMPORTANT]
====
If you installed an earlier version of the `oc` binary, you cannot use it to complete all of the commands in
ifndef::openshift-rosa,openshift-rosa-hcp[]
{product-title} {product-version}
endif::openshift-rosa,openshift-rosa-hcp[]
ifdef::openshift-rosa,openshift-rosa-hcp[]
{product-title}
endif::openshift-rosa,openshift-rosa-hcp[]
. If you want the latest features, you must download and install the latest version of the `oc` binary corresponding to your {product-title} server version.
====
// The kubectl binary
include::modules/oc-usage-kubectl.adoc[leveloffset=+1]

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.
[role="_additional-resources"]
.Additional resources

.Compatibility Matrix

[cols="1,1,1"]
|===

|
|*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)
|image:redcircle-1.png[]
|image:redcircle-3.png[]

|*X.Y+N* footnote:versionpolicyn[] (Server)
|image:redcircle-2.png[]
|image:redcircle-1.png[]

|===
image:redcircle-1.png[] Fully compatible.

image:redcircle-2.png[] `oc` client might not be able to access server features.

image:redcircle-3.png[] `oc` client might provide options and features that might not be compatible with the accessed server.

== The kubectl binary

The `kubectl` binary is provided as a means to support existing workflows and scripts for new
{product-title} 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 {product-title} cluster.

You can install the supported `kubectl` binary by following the steps to xref:../../cli_reference/openshift_cli/getting-started-cli.adoc#cli-installing-cli-linux_cli-developer-commands[Install the OpenShift CLI]. The `kubectl` binary is included in the archive if you download the binary, or is installed when you install the CLI by using an RPM.

For more information, see the link:https://kubernetes.io/docs/reference/kubectl/overview/[kubectl documentation].
* link:https://kubernetes.io/docs/reference/kubectl/overview/[kubectl (Kubernetes documentation)]
* xref:../../cli_reference/openshift_cli/getting-started-cli.adoc#cli-installing-cli_getting-started-cli[Installing the OpenShift CLI]
2 changes: 1 addition & 1 deletion microshift_cli_ref/microshift-cli-tools-introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Commands for multi-node deployments, projects, and developer tools are not suppo
== Additional resources

* xref:../microshift_cli_ref/microshift-oc-cli-install.adoc#microshift-oc-cli-install[Getting started with the OpenShift CLI]
* link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html/cli_tools/openshift-cli-oc#cli-about-cli_cli-developer-commands[About the OpenShift CLI]
* link:https://docs.redhat.com/en/documentation/openshift_container_platform/{ocp-version}/html/cli_tools/openshift-cli-oc#cli-about-cli_getting-started-cli[About the OpenShift CLI]
11 changes: 7 additions & 4 deletions modules/cli-about-cli.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
[id="cli-about-cli_{context}"]
= About the OpenShift CLI

With the {oc-first}, you can create applications and manage {product-title} projects from a terminal. The OpenShift CLI is ideal in the following situations:
[role="_abstract"]
With the {oc-first}, you can create applications and manage {product-title} projects from a terminal.

* Working directly with project source code.
The OpenShift CLI is ideal in the following situations:

* Working directly with project source code
* Scripting {product-title} operations
ifndef::microshift[]
* Managing projects while restricted by bandwidth resources and the web console is unavailable.
* Managing projects while restricted by bandwidth resources and the web console is unavailable
endif::microshift[]
ifdef::microshift[]
* Managing projects while restricted by bandwidth resources.
* Managing projects while restricted by bandwidth resources
endif::microshift[]
6 changes: 4 additions & 2 deletions modules/cli-getting-help.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
[id="cli-getting-help_{context}"]
= Getting help

You can get help with CLI commands and {product-title}
resources in the following ways:
[role="_abstract"]
Review the ways to get help with CLI commands and {product-title} resources.

.Procedure

* Use `oc help` to get a list and description of all available CLI commands:
+
Expand Down
10 changes: 10 additions & 0 deletions modules/cli-installing-cli-binary.adoc
Comment thread
bergerhoffer marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc

:_mod-docs-content-type: CONCEPT
[id="cli-installing-cli-binary_{context}"]
= Installing the OpenShift CLI by downloading the binary from the Customer Portal

[role="_abstract"]
You can download the {oc-first} from the Red{nbsp}Hat Customer Portal and install it to interact with {product-title} clusters from a terminal on Linux, Windows, or macOS.
9 changes: 7 additions & 2 deletions modules/cli-installing-cli-brew.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
= Installing the OpenShift CLI by using Homebrew

[role="_abstract"]
For macOS, you can install the OpenShift CLI (`oc`) by using the link:https://brew.sh[Homebrew] package manager.
For macOS, you can install the OpenShift CLI (`oc`) by using the Homebrew package manager.

.Prerequisites

Expand All @@ -26,8 +26,13 @@ $ brew install openshift-cli
.Verification

* Verify your installation by using an `oc` command:

+
[source,terminal]
----
$ oc <command>
----

[role="_additional-resources"]
.Additional resources

* link:https://brew.sh[Homebrew package manager]
2 changes: 1 addition & 1 deletion modules/cli-installing-cli-linux.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif::[]
= Installing the OpenShift CLI on Linux

[role="_abstract"]
To manage your cluster and deploy applications from the command line, install the {oc-first} binary on Linux.
To manage your cluster and deploy applications from the command line on Linux, install the {oc-first} binary. You can download the {oc-first} from the Red{nbsp} Customer Portal.

[IMPORTANT]
====
Expand Down
2 changes: 1 addition & 1 deletion modules/cli-installing-cli-macos.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif::[]
= Installing the OpenShift CLI on macOS

[role="_abstract"]
To manage your cluster and deploy applications from the command line, install the {oc-first} binary on macOS.
To manage your cluster and deploy applications from the command line on macOS, install the {oc-first} binary. You can download the {oc-first} from the Red{nbsp} Customer Portal.

[IMPORTANT]
====
Expand Down
7 changes: 5 additions & 2 deletions modules/cli-installing-cli-web-console-linux.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ endif::[]
[id="cli-installing-cli-web-console-macos-linux_{context}"]
= Installing the OpenShift CLI on Linux using the web console

You can install the OpenShift CLI (`oc`) binary on Linux by using the following procedure.
[role="_abstract"]
To manage your cluster and deploy applications from the command line on Linux, install the {oc-first} binary. You can download the {oc-first} from the web console.

.Procedure
ifndef::openshift-rosa,openshift-dedicated[]
Expand Down Expand Up @@ -41,8 +42,10 @@ To check your `PATH`, execute the following command:
$ echo $PATH
----

After you install the OpenShift CLI, it is available using the `oc` command:
.Verification

* After you install the OpenShift CLI, it is available using the `oc` command:
+
[source,terminal]
----
$ oc <command>
Expand Down
7 changes: 5 additions & 2 deletions modules/cli-installing-cli-web-console-macos.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ ifeval::["{context}" == "updating-restricted-network-cluster"]
:restricted:
endif::[]

You can install the OpenShift CLI (`oc`) binary on macOS by using the following procedure.
[role="_abstract"]
To manage your cluster and deploy applications from the command line on macOS, install the {oc-first} binary. You can download the {oc-first} from the web console.

.Procedure
ifndef::openshift-rosa,openshift-dedicated[]
Expand Down Expand Up @@ -40,8 +41,10 @@ To check your `PATH`, open a terminal and execute the following command:
$ echo $PATH
----

After you install the OpenShift CLI, it is available using the `oc` command:
.Verification

* After you install the OpenShift CLI, it is available using the `oc` command:
+
[source,terminal]
----
$ oc <command>
Expand Down
7 changes: 5 additions & 2 deletions modules/cli-installing-cli-web-console-windows.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ endif::[]
[id="cli-installing-cli-web-console-macos-windows_{context}"]
= Installing the OpenShift CLI on Windows using the web console

You can install the OpenShift CLI (`oc`) binary on Windows by using the following procedure.
[role="_abstract"]
To manage your cluster and deploy applications from the command line on Windows, install the {oc-first} binary. You can download the {oc-first} from the web console.

.Procedure
ifndef::openshift-rosa,openshift-dedicated[]
Expand Down Expand Up @@ -35,8 +36,10 @@ To check your `PATH`, open the command prompt and execute the following command:
C:\> path
----

After you install the OpenShift CLI, it is available using the `oc` command:
.Verification

* After you install the OpenShift CLI, it is available using the `oc` command:
+
[source,terminal]
----
C:\> oc <command>
Expand Down
7 changes: 4 additions & 3 deletions modules/cli-installing-cli-web-console.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ ifeval::["{context}" == "updating-restricted-network-cluster"]
:restricted:
endif::[]

:_mod-docs-content-type: PROCEDURE
:_mod-docs-content-type: CONCEPT
[id="cli-installing-cli-web-console_{context}"]
= Installing the OpenShift CLI by using the web console
= Installing the OpenShift CLI by downloading the binary from the web console

You can install the {oc-first} to interact with {product-title} clusters from a web console. You can install `oc` on Linux, Windows, or macOS.
[role="_abstract"]
You can download the {oc-first} from the web {product-title} console and install it to interact with {product-title} clusters from a terminal on Linux, Windows, or macOS.

[IMPORTANT]
====
Expand Down
2 changes: 1 addition & 1 deletion modules/cli-installing-cli-windows.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endif::[]
= Installing the OpenShift CLI on Windows

[role="_abstract"]
To manage your cluster and deploy applications from the command line, install {oc-first} binary on Windows.
To manage your cluster and deploy applications from the command line on Windows, install the {oc-first} binary. You can download the {oc-first} from the Red{nbsp} Customer Portal.

[IMPORTANT]
====
Expand Down
17 changes: 17 additions & 0 deletions modules/cli-installing-cli.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Module included in the following assemblies:
//
// * cli_reference/openshift_cli/getting-started.adoc

:_mod-docs-content-type: CONCEPT
[id="cli-installing-cli_{context}"]
= Installing the OpenShift CLI

ifndef::openshift-origin[]
[role="_abstract"]
To interact with a {product-title} cluster from the terminal, install the {oc-first}. Depending on your operating system, you can install {oc-first} by downloading the binary from the Customer Portal or web console, by using an RPM, or by using Homebrew.
endif::[]

ifdef::openshift-origin[]
[role="_abstract"]
To interact with a {product-title} cluster from the terminal, install the {oc-first}. Depending on your operating system, you can install {oc-first} by downloading the binary from the Customer Portal or web console, or by using Homebrew.
endif::[]
Loading