Skip to content

Commit 080e1c4

Browse files
committed
OSDOCS-4971: Restructure CLI reference book
1 parent 6c02ed8 commit 080e1c4

24 files changed

+481
-63
lines changed

_attributes/attributes-microshift.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
:OCP: OpenShift Container Platform
77
:ocp-version: 4.12
88
:rhel-major: rhel-8
9-
:op-system-first: Red Hat Enterprise Linux (RHEL)
9+
:op-system-base-full: Red Hat Enterprise Linux (RHEL)
1010
:op-system: RHEL
1111
:op-system-ostree-first: Red Hat Enterprise Linux (RHEL) for Edge
1212
:op-system-ostree: RHEL for Edge
1313
:op-system-version: 8.7
1414
:op-system-version-major: 8
1515
:op-system-ram: 2GB RAM
16-
:op-system-chip: two-core AMD64 1.5GHz processor
1716
:op-system-bundle: Red Hat Device Edge
1817
:op-system-bundle-short: RHDE
19-
:VirtProductName: OpenShift Virtualization
18+
:VirtProductName: OpenShift Virtualization

_topic_maps/_topic_map_ms.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,21 @@ Topics:
7777
File: securitycontextconstraints-security-openshift-io-v1
7878
---
7979
Name: CLI tools
80-
Dir: cli_reference
80+
Dir: microshift_cli_ref
8181
Distros: microshift
8282
Topics:
8383
- Name: CLI tools overview
84-
File: index
85-
- Name: OpenShift CLI (oc)
86-
Dir: openshift_cli
87-
Topics:
88-
- Name: Getting started with the OpenShift CLI
89-
File: getting-started-cli
90-
- Name: Configuring the OpenShift CLI
91-
File: configuring-cli
92-
# - Name: Managing CLI profiles
93-
# File: managing-cli-profiles
94-
- Name: Extending the OpenShift CLI with plugins
95-
File: extending-cli-plugins
96-
# FIXME: auto-generated content in the next file includes commands
97-
# not supported on MicroShift
98-
- Name: OpenShift CLI developer command reference
99-
File: developer-cli-commands
100-
# FIXME: Review the commands we expect to support in this file
101-
# - Name: OpenShift CLI administrator command reference
102-
# File: administrator-cli-commands
103-
# Distros: openshift-enterprise,openshift-origin
104-
- Name: Usage of oc and kubectl commands
105-
File: usage-oc-kubectl
84+
File: microshift-cli-overview
85+
- Name: Installing the OpenShift CLI
86+
File: microshift-oc-cli-install
87+
- Name: Configuring the OpenShift CLI
88+
File: microshift-oc-config
89+
- Name: Using the OpenShift CLI
90+
File: microshift-cli-using-oc
91+
- Name: Using oc and kubectl
92+
File: microshift-usage-oc-kubectl
93+
- Name: List of oc CLI commands
94+
File: microshift-oc-cli-commands-list
10695
---
10796
Name: Configuring
10897
Dir: microshift_configuring

cli_reference/index.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ A user performs a range of operations while working on {product-title} such as t
1010

1111
* Managing clusters
1212
* Building, deploying, and managing applications
13-
ifndef::microshift[]
1413
* Managing deployment processes
1514
* Developing Operators
1615
* Creating and maintaining Operator catalogs
17-
endif::[]
1816
1917
{product-title} offers a set of command-line interface (CLI) tools that simplify these tasks by enabling users to perform various administration and development operations from the terminal.
2018
These tools expose simple commands to manage the applications, as well as interact with each component of the system.
@@ -24,17 +22,12 @@ These tools expose simple commands to manage the applications, as well as intera
2422

2523
The following set of CLI tools are available in {product-title}:
2624

27-
* xref:../cli_reference/openshift_cli/getting-started-cli.adoc#cli-getting-started[OpenShift CLI (oc)]: This is the most commonly used CLI tool by {product-title} users. It helps both cluster administrators and developers to perform end-to-end operations across {product-title} using the terminal.
28-
ifndef::microshift[]
29-
Unlike the web console, it allows the user to work directly with the project source code using command scripts.
30-
endif::microshift[]
25+
* xref:../cli_reference/openshift_cli/getting-started-cli.adoc#cli-getting-started[OpenShift CLI (oc)]: This is the most commonly used CLI tool by {product-title} users. It helps both cluster administrators and developers to perform end-to-end operations across {product-title} using the terminal. Unlike the web console, it allows the user to work directly with the project source code using command scripts.
3126

32-
ifndef::microshift[]
3327
* xref:../cli_reference/kn-cli-tools.adoc#kn-cli-tools[Knative CLI (kn)]: The Knative (`kn`) CLI tool provides simple and intuitive terminal commands that can be used to interact with OpenShift Serverless components, such as Knative Serving and Eventing.
3428

3529
* xref:../cli_reference/tkn_cli/installing-tkn.adoc#installing-tkn[Pipelines CLI (tkn)]: OpenShift Pipelines is a continuous integration and continuous delivery (CI/CD) solution in {product-title}, which internally uses Tekton. The `tkn` CLI tool provides simple and intuitive commands to interact with OpenShift Pipelines using the terminal.
3630

3731
* xref:../cli_reference/opm/cli-opm-install.adoc#cli-opm-install[opm CLI]: The `opm` CLI tool helps the Operator developers and cluster administrators to create and maintain the catalogs of Operators from the terminal.
3832

3933
* xref:../cli_reference/osdk/cli-osdk-install.adoc#cli-osdk-install[Operator SDK]: The Operator SDK, a component of the Operator Framework, provides a CLI tool that Operator developers can use to build, test, and deploy an Operator from the terminal. It simplifies the process of building Kubernetes-native applications, which can require deep, application-specific operational knowledge.
40-
endif::microshift[]

cli_reference/openshift_cli/getting-started-cli.adoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ You can install the OpenShift CLI (`oc`) either by downloading the binary or by
1717
// Installing the CLI by downloading the binary
1818
include::modules/cli-installing-cli.adoc[leveloffset=+2]
1919

20-
ifndef::microshift[]
2120
// Installing the CLI by using the web console
2221
include::modules/cli-installing-cli-web-console.adoc[leveloffset=+2]
2322

@@ -29,7 +28,6 @@ include::modules/cli-installing-cli-web-console-windows.adoc[leveloffset=+3]
2928

3029
// Installing the CLI on macOS by using the web console
3130
include::modules/cli-installing-cli-web-console-macos.adoc[leveloffset=+3]
32-
endif::microshift[]
3331

3432
ifndef::openshift-origin[]
3533
// Installing the CLI by using an RPM
@@ -39,18 +37,14 @@ endif::[]
3937
// Installing the CLI by using Homebrew
4038
include::modules/cli-installing-cli-brew.adoc[leveloffset=+2]
4139

42-
ifndef::microshift[]
4340
// Logging in to the CLI
4441
include::modules/cli-logging-in.adoc[leveloffset=+1]
45-
endif::[]
4642

4743
// Using the CLI
4844
include::modules/cli-using-cli.adoc[leveloffset=+1]
4945

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

53-
ifndef::microshift[]
5449
// Logging out of the CLI
5550
include::modules/cli-logging-out.adoc[leveloffset=+1]
56-
endif::[]

microshift_cli_ref/_attributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../_attributes

microshift_cli_ref/images

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../images
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
:_content-type: ASSEMBLY
2+
[id="cli-tools-overview"]
3+
= {product-title} CLI tools
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: cli-tools-overview
6+
7+
toc::[]
8+
9+
A user builds, deploys, and manages boths applications and clusters while working with {product-title}.
10+
11+
{product-title} can use different command-line interface (CLI) tools that simplify these tasks by enabling users to perform various administration and development operations from the terminal.
12+
These tools expose simple commands to manage the deployments, as well as interact with each component of the system.
13+
14+
In addition to built-in `microshift` command types and Linux CLI tools, the optional OpenShift CLI (`oc`) tool with an enabled subset of commands is available for you to use if you are already familiar with {OCP} and Kubernetes.
15+
//more info on these tools is expected in the future, hence this overview assembly
16+
17+
[role="_additional-resources"]
18+
[id="additional-resources_cli-tools-overview"]
19+
.Additional resources
20+
21+
* link:https://access.redhat.com/documentation/en-us/microshift/4.12/html/microshift_cli_ref/microshift-cli-using-oc.adoc#microshift-cli-oc-about[Installing the `oc` tool for MicroShift].
22+
23+
* link:https://access.redhat.com/documentation/en-us/openshift_container_platform/4.12/html/cli_tools/openshift-cli-oc[OpenShift CLI (oc)]: A full description of `oc` as provided by the {OCP} documentation. Commands focused on multi-node deployments, projects, and developer tooling are not supported by {product-title}.
24+
25+
* link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9[Red Hat Enterprise Linux (RHEL)]: The RHEL documentation for your specific use case.
26+
//NEED INFO: drill down to more specific links within RHEL docs
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
:_content-type: ASSEMBLY
2+
[id="microshift-using-oc"]
3+
= Using the `oc` tool
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: microshift-using-oc
6+
7+
toc::[]
8+
9+
The optional OpenShift CLI (`oc`) tool is available for you to use if you are already familiar with {OCP} and Kubernetes.
10+
11+
include::modules/microshift-cli-oc-about.adoc[leveloffset=+1]
12+
13+
[id="cli-using-cli_{context}"]
14+
== Using the OpenShift CLI in {product-title}
15+
16+
Review the following sections to learn how to complete common tasks in {product-title} using the `oc` CLI.
17+
18+
[id="viewing-pods_{context}"]
19+
=== Viewing pods
20+
21+
Use the `oc get pods` command to view the pods for the current project.
22+
23+
[NOTE]
24+
====
25+
When you run `oc` inside a pod and do not specify a namespace, the namespace of the pod is used by default.
26+
====
27+
28+
[source,terminal]
29+
----
30+
$ oc get pods -o wide
31+
----
32+
33+
.Example output
34+
[source,terminal]
35+
----
36+
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
37+
cakephp-ex-1-build 0/1 Completed 0 5m45s 10.131.0.10 ip-10-0-141-74.ec2.internal <none>
38+
cakephp-ex-1-deploy 0/1 Completed 0 3m44s 10.129.2.9 ip-10-0-147-65.ec2.internal <none>
39+
cakephp-ex-1-ktz97 1/1 Running 0 3m33s 10.128.2.11 ip-10-0-168-105.ec2.internal <none>
40+
----
41+
42+
[id="viewing-pod-logs_{context}"]
43+
=== Viewing pod logs
44+
45+
Use the `oc logs` command to view logs for a particular pod.
46+
47+
[source,terminal]
48+
----
49+
$ oc logs cakephp-ex-1-deploy
50+
----
51+
52+
.Example output
53+
[source,terminal]
54+
----
55+
--> Scaling cakephp-ex-1 to 1
56+
--> Success
57+
----
58+
59+
[id="listing-supported-apis_{context}"]
60+
=== Listing supported API resources
61+
62+
Use the `oc api-resources` command to view the list of supported API resources
63+
on the server.
64+
65+
[source,terminal]
66+
----
67+
$ oc api-resources
68+
----
69+
70+
.Example output
71+
[source,terminal]
72+
----
73+
NAME SHORTNAMES APIGROUP NAMESPACED KIND
74+
bindings true Binding
75+
componentstatuses cs false ComponentStatus
76+
configmaps cm true ConfigMap
77+
...
78+
----
79+
80+
// Getting help
81+
include::modules/microshift-cli-oc-get-help.adoc[leveloffset=+1]
82+
83+
//Errors when using oc commands not enabled in MicroShift
84+
include::modules/microshift-oc-apis-errors.adoc[leveloffset=+1]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:_content-type: ASSEMBLY
2+
[id="microshift-oc-cli-commands"]
3+
= OpenShift CLI command reference
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: cli-administrator-commands
6+
7+
toc::[]
8+
9+
This reference provides descriptions and example commands for OpenShift CLI (`oc`) commands. You must have `cluster-admin` or equivalent permissions to use these commands.
10+
11+
Run `oc adm -h` to list all administrator commands or run `oc <command> --help` to get additional details for a specific command.
12+
13+
[IMPORTANT]
14+
====
15+
Using `oc <command> --help` lists details for any `oc` command. Not all `oc` commands apply to using {product-title}.
16+
====
17+
18+
// The OCP file is auto-generated from the openshift/oc repository; MicroShift is made manually
19+
// OpenShift CLI (oc) administrator commands
20+
include::modules/microshift-oc-by-example-content.adoc[leveloffset=+1]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
:_content-type: ASSEMBLY
2+
[id="cli-getting-started"]
3+
= Getting started with the OpenShift CLI
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: cli-oc-installing
6+
7+
toc::[]
8+
9+
To use the OpenShift CLI (`oc`) tool, you must download and install it separately from your {product-title} installation.
10+
11+
[id="installing-the-openshift-cli_{context}"]
12+
== Installing the OpenShift CLI
13+
14+
You can install the OpenShift CLI (`oc`) either by downloading the binary or by using Homebrew.
15+
16+
// Installing the CLI by downloading the binary
17+
include::modules/cli-installing-cli.adoc[leveloffset=+2]
18+
19+
// Installing the CLI by using Homebrew
20+
include::modules/cli-installing-cli-brew.adoc[leveloffset=+2]
21+
22+
// Installing the CLI using RPM
23+
include::modules/cli-installing-cli-rpm.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)