How to use the oc CLI client

Get it

The oc client binary can be downloaded from the OpenShift Web Console by clicking on the question mark (top right) and choose Command line tools. There you can find various binaries to work with OpenShift from the command line.

Login

Follow these steps to login to APPUiO Cloud on your terminal:

  1. Login to the APPUiO Cloud console:

    oc login --server=https://api.${zone}.appuio.cloud:6443

    You can find the exact URL of your chosen zone in the APPUiO Cloud Portal.

    This command displays a URL on your terminal:

    You must obtain an API token by visiting
    https://oauth-openshift.apps.${zone}.appuio.cloud/oauth/token/request
  2. Click on the link above and open it in your browser.

  3. Click "Display token" and copy the login command shown as "Log in with this token"

  4. Paste the oc login command on the terminal:

    oc login --token=sha256~_xxxxxx_xxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxx-X \
        --server=https://api.${zone}.appuio.cloud:6443

Get help

Once you have the oc client binary on your computer and have logged in to OpenShift, you can type oc help to get information what you can do with it. The upstream documentation also provides good help: Getting started with the OpenShift CLI.