mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
OSDOCS#17273:CLI concepts and configuration
This commit is contained in:
committed by
openshift-cherrypick-robot
parent
dea6097000
commit
66a2dff904
@@ -6,9 +6,10 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
[role="_abstract"]
|
||||
You can use different command-line interface (CLI) tools to build, deploy, and manage a {microshift-short} node and workloads. With CLI tools, you can complete various administration and development operations from the terminal to manage deployments and interact with each component of the system.
|
||||
|
||||
CLI tools available for use with {microshift-short} are the following:
|
||||
The following CLI tools are available to use with {microshift-short}:
|
||||
|
||||
* Kubernetes CLI (`kubectl`)
|
||||
* The {oc-first} tool with an enabled subset of commands
|
||||
@@ -24,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] ({OCP} documentation)
|
||||
* 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]
|
||||
|
||||
@@ -6,78 +6,15 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
[role="_abstract"]
|
||||
The optional {oc-first} tool provides a subset of `oc` commands for {microshift-short} deployments. Using `oc` is convenient if you are familiar with {OCP} and Kubernetes.
|
||||
|
||||
include::modules/microshift-cli-oc-about.adoc[leveloffset=+1]
|
||||
|
||||
[id="cli-using-cli_{context}"]
|
||||
== Using oc with a {microshift-short} node
|
||||
|
||||
Review the following sections to learn how to complete common tasks in {microshift-short} using the `oc` CLI.
|
||||
|
||||
[id="viewing-pods_{context}"]
|
||||
=== Viewing pods
|
||||
|
||||
Use the `oc get pods` command to view the pods for the current project.
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
When you run `oc` inside a pod and do not specify a namespace, the namespace of the pod is used by default.
|
||||
====
|
||||
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc get pods -o wide
|
||||
----
|
||||
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
|
||||
cakephp-ex-1-build 0/1 Completed 0 5m45s 10.131.0.10 ip-10-0-141-74.ec2.internal <none>
|
||||
cakephp-ex-1-deploy 0/1 Completed 0 3m44s 10.129.2.9 ip-10-0-147-65.ec2.internal <none>
|
||||
cakephp-ex-1-ktz97 1/1 Running 0 3m33s 10.128.2.11 ip-10-0-168-105.ec2.internal <none>
|
||||
----
|
||||
|
||||
[id="viewing-pod-logs_{context}"]
|
||||
=== Viewing pod logs
|
||||
|
||||
Use the `oc logs` command to view logs for a particular pod.
|
||||
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc logs cakephp-ex-1-deploy
|
||||
----
|
||||
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
--> Scaling cakephp-ex-1 to 1
|
||||
--> Success
|
||||
----
|
||||
|
||||
[id="listing-supported-apis_{context}"]
|
||||
=== Listing supported API resources
|
||||
|
||||
Use the `oc api-resources` command to view the list of supported API resources on the server.
|
||||
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc api-resources
|
||||
----
|
||||
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
NAME SHORTNAMES APIGROUP NAMESPACED KIND
|
||||
bindings true Binding
|
||||
componentstatuses cs false ComponentStatus
|
||||
configmaps cm true ConfigMap
|
||||
...
|
||||
----
|
||||
include::modules/microshift-cli-oc-logs.adoc[leveloffset=+1]
|
||||
|
||||
// Getting help
|
||||
include::modules/microshift-cli-oc-get-help.adoc[leveloffset=+1]
|
||||
|
||||
//Errors when using oc commands not enabled in MicroShift
|
||||
include::modules/microshift-oc-apis-errors.adoc[leveloffset=+1]
|
||||
include::modules/microshift-oc-apis-errors.adoc[leveloffset=+1]
|
||||
|
||||
@@ -6,30 +6,10 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
Descriptions and example commands for {oc-first} commands are included in this reference document. You must have `cluster-admin` or equivalent permissions to use these commands. To list administrator commands and information about them, use the following commands:
|
||||
[role="_abstract"]
|
||||
Descriptions and example commands for {oc-first} commands are included in this reference document. You must have `cluster-admin` or equivalent permissions to use these commands.
|
||||
|
||||
* Enter the `oc adm -h` command to list all administrator commands:
|
||||
+
|
||||
.Command syntax
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc adm -h
|
||||
----
|
||||
|
||||
* Enter the `oc <command> --help` command to get additional details for a specific command:
|
||||
+
|
||||
.Command syntax
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc <command> --help
|
||||
----
|
||||
|
||||
[IMPORTANT]
|
||||
====
|
||||
Using `oc <command> --help` lists details for any `oc` command. Not all `oc` commands apply to using {product-title}.
|
||||
====
|
||||
include::modules/microshift-oc-cmd.adoc[leveloffset=+1]
|
||||
|
||||
// The OCP files are auto-generated from the openshift/oc repository; use the MicroShift-specific flags to generate MicroShift command files from the same repo
|
||||
include::modules/microshift-oc-by-example-content.adoc[leveloffset=+1]
|
||||
|
||||
@@ -6,6 +6,7 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
[role="_abstract"]
|
||||
To use the {oc-first} tool, you must download and install it separately from your {microshift-short} installation. You can install `oc` by downloading the binary or by using Homebrew.
|
||||
|
||||
// Installing the OpenShift CLI on Linux
|
||||
@@ -21,4 +22,4 @@ include::modules/cli-installing-cli-macos.adoc[leveloffset=+1]
|
||||
include::modules/cli-installing-cli-brew.adoc[leveloffset=+1]
|
||||
|
||||
// Installing the CLI using RPM
|
||||
include::modules/cli-installing-cli-rpm.adoc[leveloffset=+1]
|
||||
include::modules/cli-installing-cli-rpm.adoc[leveloffset=+1]
|
||||
|
||||
@@ -6,6 +6,7 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
[role="_abstract"]
|
||||
Configure {oc-first} based on your preferences for working with it.
|
||||
|
||||
[id="cli-enabling-tab-completion"]
|
||||
|
||||
@@ -6,6 +6,7 @@ include::_attributes/attributes-microshift.adoc[]
|
||||
|
||||
toc::[]
|
||||
|
||||
[role="_abstract"]
|
||||
The Kubernetes command-line interface (CLI), `kubectl`, can be used to run commands against a Kubernetes cluster. Because {microshift-short} is a certified Kubernetes distribution, you can use the supported `kubectl` CLI tool or you can gain extended functionality by using the {oc-first}.
|
||||
|
||||
[id="microshift-kubectl-binary_{context}"]
|
||||
|
||||
Reference in New Issue
Block a user