Authenticating with OpenShift Connector from Che

The following section is relevant only when the OpenShift OAuth service does not already authenticate a Che instance; otherwise, the OpenShift Connector plug-in automatically establishes the authentication with the Openshift instance where Che runs.

Before the user can develop and push Components from Che, they need to authenticate with an OpenShift cluster.

OpenShift Connector offers the following methods for logging in to the OpenShift Cluster from the Che instance:

  • Using the notification that asks to log in to the OpenShift cluster where Che is deployed to.

  • Using the Log in to the cluster button.

  • Using the Command Palette.

In Che 7.23, Openshift Connector plug-in requires manual connecting to the target cluster

By default, the Openshift Connector plug-in logs into the cluster as inClusterUser, which may not have the manage project permission. This causes an error message to be displayed when a new project is being created using Openshift Application Explorer:

Failed to create Project with error 'Error: Command failed: "/tmp/vscode-unpacked/redhat.vscode-openshift -connector.latest.qvkozqtkba.openshift-connector-0.1.4-523.vsix/extension/out/tools/linux/odo" project create test-project ✗ is forbidden

To work around this temporary issue, log out from the local cluster and relog in to OpenShift cluster using the OpenShift user’s credentials.

When using a local instance of OpenShift (such as CodeReady Containers or Minishift), the user’s credentials are stored in the workspace ~/.kube/config file, and may be used for automatic authentication in subsequent logins. In the context of Che, the ~/.kube/config is stored as a part of the plug-in sidecar container.

  • A running instance of Che. To install an instance of Che, see Installing Che.

  • A Che workspace has been created.

  • The OpenShift Connector plug-in is available.

  • The OpenShift OAuth provider is configured (only for the auto-login to the OpenShift cluster where Che is deployed. See Configuring OpenShift OAuth).

  1. In the left panel, select the OpenShift Application Explorer icon.

    The OpenShift Connector panel is displayed.

  2. Log in using the OpenShift Application Explorer. Use one of the following methods:

    • Click the Log in to cluster button in the top left corner of the pane.

    • Press F1 to open the Command Palette, or navigate to View → Find Command in the top menu.

      Search for OpenShift: Log in to cluster and press Enter.

  3. If a You are already logged in a cluster. message appears, click Yes.

    A selection whether to log in using Credentials or Token is displayed at the top of the screen.

  4. Select the method to log in to the cluster and follow the login instructions.

    For authenticating with a token, the required token information is in the top right corner of the main OpenShift Container Platform screen, under <User name> → Copy Login Command.