openshift101
1.0.0
1.0.0
  • Introduction
  • Getting Started
    • Create an IBM Cloud account / Access an OpenShift cluster
    • Accessing the IBM Cloud Shell
  • Workshop
    • Exercise 1: Deploy a Node application with Source-to-Image
    • Exercise 2: Logging and monitoring
    • Exercise 3: Metrics and dashboards
    • Exercise 4: Scaling the application
    • Exercise 5: Health checks
    • Exercise 6: Deploy a Node application with Build Config (CLI version)
  • Alternates
    • Exercise 1: Deploy a Java application with a Docker Image
    • Exercise 6: Deploy a Java application with Build Config (CLI version)
  • Resources
    • FAQ
    • A General Docker Tutorial
    • Kubernetes Overview
    • Setup CLI Access for the cluster
    • Certification on CognitiveClass.ai
    • IBM Developer
    • Docs: Red Hat OpenShift on IBM Cloud
  • Survey
    • Tell us how we did
Powered by GitBook
On this page
  • Install OpenShift CLI tools
  • Access the OpenShift Web Console
  • Access your cluster using the oc CLI
  • Validate cluster access using oc commands

Was this helpful?

  1. Resources

Setup CLI Access for the cluster

PreviousKubernetes Overview

Last updated 4 years ago

Was this helpful?

This section documents how to set up CLI access to a cluster. If you do not already have access to a cluster, refer back to the section.

Install OpenShift CLI tools

The oc CLI will be the main mechanism to interact with your OpenShift cluster. We'll be downloading and installing the CLI, and adding it to your environment path.

NOTE: Check for newer releases on the page.

Download the oc tarball.

wget https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz

Unpack the tarball

tar -xvzf openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz

Rename it for ease of use

mv openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit ${HOME}/oc-cli

Update PATH.

NOTE: If you restart your cloud shell, you may need to re-run this command.

export PATH=${PATH}:${HOME}/oc-cli

Verify the utility is available by using which and the help command.

which oc
oc help

Access the OpenShift Web Console

Click on OpenShift web console on the top right to launch the web console.

Once in the OpenShift web console, click on the email/ID in the upper right. Choose the Copy Login Command option.

Access your cluster using the oc CLI

In a new termimal, paste the login command you copied from the web console.

oc login https://c100-e.us-south.containers.cloud.ibm.com:30360 --token=NYVkVysxxxxxxxxxxxxxxxxxxxxRQa8tM

You should see a success message similar to the one below:

oc login https://c100-e.us-south.containers.cloud.ibm.com:30360 --token=NYVkVysxxxxxxxxxxxxxxxxxxxxRQa8tM

Logged into "https://c100-e.us-south.containers.cloud.ibm.com:30360" as "IAM#stevemar@ca.ibm.com" using the token provided.

You have access to the following projects and can switch between them with 'oc project <projectname>'

Validate cluster access using oc commands

View nodes in the cluster.

oc get node

View services, deployments, and pods.

oc get svc,deploy,po --all-namespaces

View projects

oc get projects

To launch the OpenShift web console, navigate to the , find your cluster, and click on it.

Getting Started
OpenShift Origin Releases
IBM Cloud Clusters Dashboard
Clusters Dashboard
Launch the OpenShift web console
Copy the login credentials