🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

OpenShift: How to Install OpenShift CLI oc

MacOS

This is actually a really quick process so this article is going to be short. This process will show you how to do the following:

  • How to Install Brew for MacOS
  • How to Install the OpenShift CLI using Brew
  • How to Utilize the Login Command with Token to Access a Cluster

Step 1. Install Brew for MacOS

Run the following command to install brew in a terminal window:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Note: After you run the command there are some additional commands that will be asked to run in order to run brew. If this is not run successfully a command not found will display when running the brew command.

Step 2. Install the OpenShift CLI using Brew

Run the following command in the terminal to install the OpenShift (aka OC) CLI utility:

$ brew install openshift-cli

Windows

https://access.redhat.com/downloads/content/290/ver=4.18/rhel—9/4.18.8/x86_64/product-software

Linux

https://access.redhat.com/downloads/content/290/ver=4.18/rhel—9/4.18.8/x86_64/product-software


mkdir /ocp-tools
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.6/openshift-client-linux.tar.gz -P /ocp-tools
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-4.6/openshift-install-linux.tar.gz -P /ocp-tools
ls -la /ocp-tools
cd /ocp-tools
chmod 777 *
tar xvf openshift-install-linux.tar.gz openshift-install
tar xvf openshift-client-linux.tar.gz oc kubectl
cp oc kubectl /usr/local/bin

oc version
kubectl version
/ocp-tools/openshift-install version

Install OC client in Ubuntu/Debian

Get the oc client download URL

Go to this link to get your desired version of the OC client tool. I have choosen the latest version available in July, 2020.

https://github.com/openshift/okd/releases/download/4.5.0-0.okd-2020-07-14-153706-ga/openshift-client-linux-4.5.0-0.okd-2020-07-14-153706-ga.tar.gz

Download the package

wget https://github.com/openshift/okd/releases/download/4.5.0-0.okd-2020-07-14-153706-ga/openshift-client-linux-4.5.0-0.okd-2020-07-14-153706-ga.tar.gz

Extract the package

tar -xvf openshift-client-linux-4.5.0-0.okd-2020-07-14-153706-ga.tar.gz

Move oc and kubectl file to your expected directory

sudo mv oc kubectl /usr/local/bin/

Now you can start using OC command

oc version

** You may need to add the installation path in your bash profile

Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x