Install the client
Install the OpenShift Command Line Interface (CLI): oc
to access the DSRI from your computer's terminal.
The oc
CLI enables to perform operations on your applications deployed on the DSRI, such as:
- Copy large files to or from the DSRI using
oc cp
- Connect to an application terminal using
oc rsh
- Get the applications running in your project with
oc get pods
Install the oc
client
On Linux
Download the oc
and kubectl
Command Line Interface clients:
wget https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz && tar xvf oc.tar.gz
sudo mv oc kubectl /usr/local/bin/
On Mac
Use brew
:
brew install openshift-cli
Or manually download the program and add it to your path:
Download https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/macosx/oc.tar.gz
Unzip the archive
Move the
oc
binary to a directory on your PATH.To check your
PATH
, open a terminal and execute the following command:echo $PATH
On Windows
- Create a folder for OpenShift in Program Files:
C:\Program Files (x86)\OpenShift
- Click here to download the
oc
tool.zip
file, and move it toC:\Program Files (x86)\OpenShift
. - Extract the
.zip
file. - Next set the system PATH environment variables for the directory containing the
oc.exe
file, which now resides in your newly created OpenShift folder inside ofC:\Program Files (x86)\OpenShift
- Open the Control Panel, and click on System
- Click on Advance system settings on the left or open the Advance tab of System Properties.
- Click the button labeled Environment Variables... at the bottom.
- Look for the option Path in either the User variables section (for the current user) or the System variables section (for all users on the system).
This makes it easy to access the oc
command line interface by simply opening up the PowerShell and typing in the oc
command, e.g.:
oc version
See the official documentation to install the client if needed.
Login in the terminal with oc
To use the oc
Command Line Interface, you will need to authenticate to the DSRI in your terminal:
Authentication to the oc
Command Line Interface using your password is not supported.
oc login --token=<token>
The token is provided by the Web UI:
Go to the DSRI web UI.
Click on the Copy Login Command button (in the top right of the page).
Paste the copied command in your terminal, and execute it to login with
oc
🔑
The command should look like this:
oc login https://api.dsri2.unimaas.nl:6443 --token=$GENERATED_TOKEN