Accessing clusters through the public cloud service endpoint

For Red Hat OpenShift Classic and VPC clusters that have a public cloud service endpoint enabled, you can log in from the IBM Cloud console or the CLI.

Before you begin

  1. Install the required CLI tools.
  2. If your network is protected by a company firewall, allow access to the required API endpoints and ports.
  3. Verify your cluster is healthy: ibmcloud oc cluster get -c CLUSTER_NAME_OR_ID.

Connecting from the IBM Cloud console

  1. In the IBM Cloud console, navigate to your cluster.
  2. Click Red Hat OpenShift web console.
  3. To continue in the CLI, click your profile name, then click Copy Login Command.
  4. Click Display Token, copy the oc login command, and paste it into your terminal.

Log out of both the IBM Cloud console and the Red Hat OpenShift web console before closing your browser. You must complete both steps to successfully log out.

Connecting from the CLI

Choose one of the following options.

Log in as admin

Run the following command to download the TLS certificates and set the cluster context. Requires the Administrator platform access role.

ibmcloud oc cluster config -c CLUSTER_NAME_OR_ID --admin

Log in with a passcode

  1. Get the master URL: ibmcloud oc cluster get -c CLUSTER_NAME_OR_ID
  2. Open https://iam.cloud.ibm.com/identity/passcode and copy your one-time passcode.
  3. Log in to the cluster.
    oc login -u passcode -p <iam_passcode> --server=<master_URL>
    

Log in with an API key

See Accessing clusters from automation tools by using an API key.