Installing Prerequisites¶
Audience: Application developers, Administrators
Overview¶
The production reference guide uses many different command line tools to allow you interact with the cluster from your local machine. Tools such as oc
, git
and jq
help you to understand how a cloud native deployment works in a hands-on manner.
For Windows users please follow these instructions windows.md
In this topic, we're going to:
- Learn how to install the prerequisite command line tools
Where appropriate, click on the macOS or Linux horizontal tab to see the corresponding operating system instructions.
Installing a package manager¶
A operating system specific package manager is used to install the prerequisite tools on the different platforms.
On macOS, we use the homebrew package manager to install the prerequisite tools
On the terminal command line, issue the following command to see if homebrew is installed:
brew --version
You should see the following output if homebrew is installed:
Homebrew 3.3.5
Homebrew/homebrew-core (git revision 63e2388f12d; last commit 2021-11-24)
Homebrew/homebrew-cask (git revision b8049f243b; last commit 2021-11-24)
If it is not installed, use the Install Homebrew instructions.
For Linux we will use RHEL 8 and dnf
as an example, RHEL 7 users should be able to replace dnf
with yum
.
Refer to the Red Hat Subscription Manager for instructions on setting up your RHEL subscriptions and repositories.
Installing git
¶
The git
command line tool is used extensively throughout the tutorial to interact with git and GitHub. We perform GitOps operations using commands such as git push
to make a change to a cluster.
Install git
using the following command:
brew install git
dnf install git
Learn more about git
.
Use git --version
to ensure you are using version 2 or higher.
Installing gh
¶
The gh
command line tool is the official command line to interact with GitHub. It is used some command scripts, for example to create a repository from a GitHub template.
Install gh
using the following command:
brew install gh
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
dnf install gh
Learn more about gh
.
Use gh --version
to ensure you are using version 2 or higher.
Installing jq
¶
jq
is a utility used to manipulate the JSON output typically returned by the oc
command when reading or updating Kubernetes resources.
Install jq
using the following command:
brew install jq
dnf install jq
Learn more about jq
.
Installing node
, npm
& nvm
¶
This trio of technologies is used to install various node.js
based utilities used in the tutorial.
Note
nvm
is optional.
node¶
Install node
using the following command:
brew install node
dnf groupinstall 'Development Tools'
dnf module install nodejs/development
npm¶
npm
is the package manager used to install different node.js packages.
Install npm
using the following command:
brew install npm
npm
gets installed as part of the 'Development Tools' in the node
install step.
Learn more about npm
.
nvm¶
nvm (node version manager) allows you to install and use different versions of node.js
.
Reminder
Installing nvm
is optional.
Install nvm
using the following command:
brew install nvm
To install nvm
on Linux see: nvm
Installing tree
¶
tree
is a command-line tool display a file system structure by displaying folders and files in tree-like structure.
Install tree
using the following command:
brew install tree
dnf install tree
Learn more about tree
.
Installing watch
¶
watch
is a utility used to periodically monitor the output of a command. It is useful in checking the status of long running processes such as deployments.
Install watch
using the following command:
brew install watch
dnf install watch
Learn more about watch
.
Installing oc
¶
The oc
command is used to interact with an OpenShift cluster. It is effectively a synonym for the kubectl
command with some additional options.
Use these instructions to get the latest version of oc
.
You can use oc version
to confirm that you have:
Client Version: 4.6
or higherServer Version: 4.7
or higher
The version of oc
must be compatible with the version of the cluster you previously created.
Tip
Red Hat Linux users with an appropriate Red Hat subscription can also use dnf
to install oc
.
subscription-manager list --available --matches '*OpenShift*'
subscription-manager attach --pool=<pool id>
subscription-manager repos --enable="rhocp-4.8-for-rhel-8-x86_64-rpms"
dnf install openshift-clients