Authenticating with the OCP cluster via the command line oc utility
Authenticating via CLI¶
Members of the CentOS CI Infrastructure team have admin access for ocp.ci and ocp.stg.ci Openshift clusters for their ACO accounts.
To login via the CLI using your main account authenticated via ACO simply:
- Authenticate via accounts-centos-org option in ocp.ci/ocp.stg.ci
- In the top right of the Openshift console, click the drop down menu for your user and click
Copy Login Command - Copy the
Log in with this token: oc login --token=xxxx --server=https://uriand paste into your terminal
To login via the CLI using the system:admin user simply:
- ssh to the admin node which corresponds with
ocp-ci-managementorocp-ci-management-stginventory group - Change user to the ocp admin user on the admin node choose appropriate version:
sudo su - ocpadmor for stagingsudo su - ocpadmstg export /home/<ocpadmuser>/.kube/config- You should now have
system:adminaccess to the cluster.