1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
= Accessing the {openshift} cluster with the {openshift} CLI
Access the {ocp} cluster managed by {prod} by using the {openshift} CLI ([command]`oc`).
.Prerequisites
* {prod} is configured to use the {openshift} preset.
For more information, see link:{crc-gsg-url}#changing-the-selected-preset_gsg[Changing the selected preset].
* A running {prod} instance.
For more information, see link:{crc-gsg-url}#starting-the-instance_gsg[Starting the instance].
.Procedure
. Run the [command]`{bin} oc-env` command to print the command needed to add the cached [command]`oc` executable to your `$PATH`:
+
[subs="+quotes,attributes"]
----
$ {bin} oc-env
----
. Run the printed command.
. Log in as the `developer` user:
+
[subs="+quotes,attributes"]
----
$ oc login -u developer https://api.crc.testing:6443
----
+
[NOTE]
====
The [command]`{bin} start` command prints the password for the `developer` user.
You can also view it by running the [command]`{bin} console --credentials` command.
====
. You can now use [command]`oc` to interact with your {ocp} cluster.
For example, to verify that the {ocp} cluster Operators are available, log in as the `kubeadmin` user and run the following command:
+
[subs="+quotes,attributes",options="nowrap"]
----
$ oc config use-context crc-admin
$ oc whoami
kubeadmin
$ oc get co
----
+
[NOTE]
====
{prod} disables the Cluster Monitoring Operator by default.
====
See link:{crc-gsg-url}#troubleshooting_gsg[Troubleshooting {prod}] if you cannot access the {ocp} cluster managed by {prod}.
.Additional resources
* The link:https://docs.openshift.com/container-platform/latest/applications/projects/working-with-projects.html[{ocp} documentation] covers the creation of projects and applications.
|