Skip to content

OpenShift 4 CodeReady Containers

Endi S. Dewata edited this page Oct 18, 2023 · 6 revisions

Prerequisites

  • RAM: 10 GB

Installing OpenShift Clients

$ dnf install origin-clients

Installing OpenShift Cluster

Download the CodeReady Containers:

$ wget https://mirror.openshift.com/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz
$ tar xvf crc-linux-amd64.tar.xz
$ cd crc-linux-1.7.0-amd64
$ ./crc setup

Starting OpenShift Cluster

Start the CodeReady Containers with the following command:

$ ./crc start

When asked, provide the Pull Secret from the Download page.

Setting Up SSH Tunnel

To access CRC remotely, configure /etc/hosts as follows:

127.0.0.1 localhost localhost.localdomain localhost4 api.crc.testing canary-openshift-ingress-canary.apps-crc.testing console-openshift-console.apps-crc.testing default-route-openshift-image-registry.apps-crc.testing downloads-openshift-console.apps-crc.testing oauth-openshift.apps-crc.testing

then start SSH tunnel:

$ sudo ssh -N -L 443:<CRC IP>:443 -i ~/.ssh/id_rsa <username>@<hostname>

The console can be accessed at https://console-openshift-console.apps-crc.testing.

Authentication

To display access credentials:

$ ./crc console --credentials

To authenticate as developer:

$ oc login -u developer -p developer https://api.crc.testing:6443

To authenticate as kubeadmin:

$ oc login -u kubeadmin -p <password> https://api.crc.testing:6443

Starting OpenShift Console

To display access credentials:

$ ./crc console --credentials

To start the console:

$ ./crc console

Stopping OpenShift Cluster

$ ./crc stop

Removing OpenShift Cluster

$ ./crc delete

See Also

Clone this wiki locally