Skip to content

Commit 66e1dd7

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into main
2 parents 3e66940 + 0acaf38 commit 66e1dd7

File tree

6 files changed

+446
-11
lines changed

6 files changed

+446
-11
lines changed

.github/workflows/test-lp.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Test Learning Path
22
on: pull_request
3+
env:
4+
HUGO_VERSION: 0.130.0
5+
36
jobs:
47
Test-Pull-Request:
58
runs-on: ubuntu-24.04-arm
@@ -8,9 +11,13 @@ jobs:
811
uses: actions/checkout@v4
912
with:
1013
ref: ${{ steps.vars.outputs.branch-name }}
14+
- name: Setup Hugo
15+
uses: peaceiris/actions-hugo@v3
16+
with:
17+
hugo-version: ${{ env.HUGO_VERSION }}
18+
extended: true
1119
- name: Run hugo command to test site builds
1220
run: |
13-
sudo apt-get install -y hugo
1421
hugo
1522
- name: Get all changed markdown files
1623
id: changed-markdown-files

content/install-guides/oc.md

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
---
2+
title: OpenShift CLI (oc)
3+
4+
draft: true
5+
6+
author: Jason Andrews
7+
8+
official_docs: https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/cli_tools/openshift-cli-oc#cli-getting-started
9+
minutes_to_complete: 10
10+
11+
additional_search_terms:
12+
- OpenShift
13+
- Kubernetes
14+
15+
layout: installtoolsall
16+
multi_install: false
17+
multitool_install_part: false
18+
test_images:
19+
- ubuntu:latest
20+
test_maintenance: false
21+
tool_install: true
22+
weight: 1
23+
---
24+
25+
The OpenShift command-line interface (CLI), `oc`, allows you to work with OpenShift Container Platform projects from a terminal. You can use `oc` to create applications, manage OpenShift Container Platform projects, and perform administrative tasks.
26+
27+
The OpenShift CLI is a superset of the Kubernetes `kubectl` command. When you install `oc`, you get both the OpenShift-specific functionality and all standard Kubernetes `kubectl` commands in a single tool. This means you can use `oc` to manage both OpenShift and standard Kubernetes resources.
28+
29+
The OpenShift CLI is available for macOS and Linux and supports the Arm architecture.
30+
31+
## What should I consider before installing the OpenShift CLI?
32+
33+
This article provides a quick solution to install the latest version of the OpenShift CLI for Ubuntu on Arm and macOS with Apple Silicon.
34+
35+
Confirm you are using an Arm computer by running:
36+
37+
```bash { target="ubuntu:latest" }
38+
uname -m
39+
```
40+
41+
If you are on Arm Linux the output should be:
42+
43+
```output
44+
aarch64
45+
```
46+
47+
If you are on macOS with Apple Silicon the output should be:
48+
49+
```output
50+
arm64
51+
```
52+
53+
## How do I download and install the OpenShift CLI?
54+
55+
There are multiple ways to install the OpenShift CLI. The methods below download the latest stable version directly from the OpenShift mirror.
56+
57+
### Install on Arm Linux
58+
59+
To install the OpenShift CLI on Arm Linux:
60+
61+
```bash { target="ubuntu:latest" }
62+
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux-arm64.tar.gz
63+
tar -xzf openshift-client-linux-arm64.tar.gz
64+
sudo mv oc kubectl /usr/local/bin/
65+
rm openshift-client-linux-arm64.tar.gz README.md
66+
```
67+
68+
### Install on macOS
69+
70+
To install the OpenShift CLI on macOS with Apple Silicon:
71+
72+
```console
73+
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-mac-arm64.tar.gz
74+
tar -xzf openshift-client-mac-arm64.tar.gz
75+
sudo mv oc kubectl /usr/local/bin/
76+
rm openshift-client-mac-arm64.tar.gz README.md
77+
```
78+
79+
Both installations include both `oc` and `kubectl` commands. The `oc` command provides the full OpenShift functionality, while the `kubectl` command gives you compatibility with standard Kubernetes clusters. Since `oc` is a superset of `kubectl`, you can use `oc` for all Kubernetes operations, but having both commands available gives you flexibility in your workflow.
80+
81+
## Understanding oc and kubectl
82+
83+
The OpenShift CLI (`oc`) is built as a superset of the Kubernetes CLI (`kubectl`).
84+
85+
This means:
86+
87+
- You can use `oc` anywhere you would use `kubectl`
88+
- OpenShift-specific features such as `oc login`, `oc new-project`, `oc new-app`, are available to manage OpenShift resources
89+
90+
## How do I verify the OpenShift CLI installation?
91+
92+
Verify the OpenShift CLI is installed by checking the version:
93+
94+
```bash { target="ubuntu:latest" }
95+
oc version --client
96+
```
97+
98+
The output shows the client version information:
99+
100+
```output
101+
Client Version: 4.19.3
102+
Kustomize Version: v5.5.0
103+
```
104+
105+
You can also verify that `kubectl` is available and shows the same version (since it's the same binary):
106+
107+
```bash { target="ubuntu:latest" }
108+
kubectl version --client
109+
```
110+
111+
The output shows the kubectl client version:
112+
113+
```output
114+
Client Version: v1.32.1
115+
Kustomize Version: v5.5.0
116+
```
117+
118+
Both commands are now available for managing Kubernetes and OpenShift resources.
119+
120+
## How do I get started with the OpenShift CLI?
121+
122+
To get help with available commands, run:
123+
124+
```console
125+
oc help
126+
```
127+
128+
This displays the main command groups and options:
129+
130+
```output
131+
OpenShift Client
132+
133+
This client helps you develop, build, deploy, and run your applications on any
134+
OpenShift or Kubernetes cluster. It also includes the administrative
135+
commands for managing a cluster under the 'adm' subcommand.
136+
137+
Usage:
138+
oc [flags]
139+
140+
Basic Commands:
141+
login Log in to a server
142+
new-project Request a new project
143+
new-app Create a new application
144+
status Show an overview of the current project
145+
project Switch to another project
146+
projects Display existing projects
147+
explain Get documentation for a resource
148+
149+
Build and Deploy Commands:
150+
rollout Manage the rollout of a resource
151+
rollback Revert part of an application back to a previous deployment
152+
new-build Create a new build configuration
153+
start-build Start a new build
154+
cancel-build Cancel running, pending, or new builds
155+
import-image Import images from a Docker registry
156+
tag Tag existing images into image streams
157+
158+
Application Management Commands:
159+
create Create a resource from a file or from stdin
160+
apply Apply a configuration to a resource by file name or stdin
161+
get Display one or many resources
162+
describe Show details of a specific resource or group of resources
163+
edit Edit a resource on the server
164+
set Commands that help set specific features on objects
165+
label Update the labels on a resource
166+
annotate Update the annotations on a resource
167+
expose Expose a replicated application as a service or route
168+
delete Delete resources by file names, stdin, resources and names, or by resources and label selector
169+
scale Set a new size for a deployment, replica set, or replication controller
170+
autoscale Autoscale a deployment or replica set
171+
secrets Manage secrets
172+
serviceaccounts Manage service accounts in your project
173+
174+
Troubleshooting and Debugging Commands:
175+
logs Print the logs for a resource
176+
rsh Start a shell session in a pod
177+
rsync Copy files between a local file system and a pod
178+
port-forward Forward one or more local ports to a pod
179+
debug Launch a new instance of a pod for debugging
180+
exec Execute a command in a container
181+
proxy Run a proxy to the Kubernetes API server
182+
attach Attach to a running container
183+
run Run a particular image on the cluster
184+
cp Copy files and directories to and from containers
185+
wait Experimental: Wait for a specific condition on one or many resources
186+
187+
Advanced Commands:
188+
adm Tools for managing a cluster
189+
create Create a resource from a file or from stdin
190+
replace Replace a resource by file name or stdin
191+
patch Update fields of a resource
192+
process Process a template into list of resources
193+
export Export resources so they can be used elsewhere
194+
extract Extract secrets or config maps to disk
195+
observe Observe changes to resources and react to them (experimental)
196+
policy Manage authorization policy
197+
auth Inspect authorization
198+
image Useful commands for managing images
199+
registry Commands for working with the registry
200+
idle Idle scalable resources
201+
api-versions Print the supported API versions on the server, in the form of "group/version"
202+
api-resources Print the supported API resources on the server
203+
cluster-info Display cluster information
204+
diff Diff the live version against a would-be applied version
205+
kustomize Build a kustomization target from a directory or URL
206+
207+
Settings Commands:
208+
logout End the current server session
209+
config Modify kubeconfig files
210+
whoami Return information about the current session
211+
completion Output shell completion code for the specified shell (bash, zsh, fish, or powershell)
212+
213+
Other Commands:
214+
help Help about any command
215+
plugin Provides utilities for interacting with plugins
216+
version Print the client and server version information
217+
218+
Use "oc <command> --help" for more information about a given command.
219+
Use "oc options" for a list of global command-line options (applies to all commands).
220+
```
221+
222+
To connect to an OpenShift cluster, you need to log in using:
223+
224+
```console
225+
oc login <cluster-url>
226+
```
227+
228+
Replace `<cluster-url>` with your OpenShift cluster's URL. You will be prompted for your username and password.
229+
230+
You are now ready to use the OpenShift CLI to manage your OpenShift Container Platform projects and applications.

0 commit comments

Comments
 (0)