How to install OpenShift on your Mac


OpenShift CodeReady Containers (CRC) is a tool that provides a minimal, pre-configured OpenShift cluster that you can run on your local machine. This allows developers to develop and test their applications in a local, fully functional OpenShift environment without the need for a full-scale production setup.


For us, Mulesoft Developers and Architects, it is a quick way to have an OpenShift environment to test the installation of Runtime Fabric on this platform. 

In this post, we’ll see the steps we need to follow to get it installed on our macOS.

Create the Cluster

 

  • Click on Create Cluster
  • Then click on the Local tab. 
  • Select your Operating System (in our case it would be MacOS) and click on Download OpenShift Local
  • Download as well the pull secret (or copy it to the clipboard)
  • Choose your installation folder. Create a new folder for the installation files and move the downloaded file into this folder
mkdir ~/openshift

Run the Red Hat OpenShift Local Installer

  • Double-click the file to start the installation wizard and click continue in the welcome page.
  • Click continue on the Software Licence Agreement
  • Click Continue and Agree
  • click Install
  • When the installation is finished click close

Setup the Openshift cluster

  • Open a terminal and Run the command
crc setup
  • It will take a while to download and decompress so grab a cup of coffee :)

Start OpenShift CRC

  • From your terminal run the command
crc start
  • That will start up your CRC cluster. You’ll be prompted to enter the pull secret. That’s the secret we got when we created the cluster in the web console. Paste the secret.
  • When the CRC cluster is ready we’ll get in the terminal the credentials to log in and the URL of the web console
  • Go to the URL provided
https://console-openshift-console.apps-crc.testing
  • Log in with the kubeadmin credentials provided
  • Et voila’! Congratulations, your CRC cluster is ready!

Access OpenShift from the CLI

  • Add the oc binary to the PATH. For that, run the command 
crc oc-env
that will print out the command needed.
  • Next, run the command
eval $(crc oc-env)
  • Log In to OpenShift. For that, we run the following command to display the login credentials
crc console --credentials
  • Run the command indicated to log in as kubeadmin
oc login -u kubeadmin -p 345xp-nRgLy-aXUzF-K4xga https://api.crc.testing:6443
  • An finally, test it. Run oc get co to check the OpenShift Cluster Operators and if we get a valid answer it’ll mean it’s working

Previous Post Next Post