Local Openshift Cluster using Redhat CodeReady Containers on MacOS

K8s is a container orchestration framework. It provides many features that make it an attractive option for developers who are looking to deploy their applications on containers. As organizations start using multi-cloud, multi-cluster deployments, they end up creating very complex operating environments.

RedHat CodeReady Containers

Red Hat OpenShift is a distribution of Kubernetes, Docker and other open source technologies.

It's an enterprise-ready container application platform and provides everything you need to build, deploy and manage applications in a cloud environment.

Let's look at how to set up a local OpenShift cluster environment using Redhat CodeReady Containers

Min-System Requirements
4 CPU cores
- 9 GB Free Memory
- 35 GB Disk Space

Note: CodeReady Containers currently do not support M1 architecture chips

Step 1: Download the installer package from RedHat's official distribution

Note: You will need to register and sign in to download the distribution package

download RedHat CodeReady containers package and pull secret

Download both the distribution and pull-secret.txt file to your local machine

Step 2: Install the `crc-macos-amd64.pkg` file

You may be required to provide the sudo password during installation

install RedHat CodeReady containers pkg

Once the installation is complete, you should see a new icon for Code Ready Containers in your Mac's application drawer.

Step 3: Start the CodeReady Containers Setup Process by initiating the application.

Provide your pull-secret by copying the contents from the downloaded initially pull-secret file

The setup process may take up to 5 mins depending on the speed of your machine

Step 4: Once the setup is complete, validate the installation by firing up a terminal and running the crc status command

It should say the Machine does not exist. Use 'crc start' to create it

This confirms the installation of the CodeReady Container Application crc

Step 5: In the terminal, type in crc start

This will initiate the creation of an Openshift cluster with default settings.

Note: this is a slow operation, and it took close to 8 mins on my i7 Mac with 32GB RAM. Be Patient…

Once the installation is complete, you should see the following.

CRC installation complete

Note down the passwords for kubeadmin and developer users to log in to the console

If you wish to recover these passwords, use the command
crc console --credentials

Step 6: Next, let's try firing up the Openshift console
You can either copy-paste the URL from the above installation screen onto a browser window or type crc console on the terminal to launch the console in the default browser

Login using developer or kubeadmin with the generated password

On login, you should see an exhaustive OpenShift dashboard like below:

You should be able to create, manage and destroy Pods, projects, operators etc. from the dashboard

Step 7: Alternatively, if you wish to use command-line for Openshift management, you can configure your shell to use the oc commands

Configure your shell using
eval $(crc oc-env)

and then log in to the console using the terminal command as below
oc login -u developer {url_from_installation_step}

to check your current user, type
oc whoami

and to switch between developer and kubeadmin use
oc config use-context crc-developer
oc config use-context crc-admin

That's all!

I hope you found this helpful; Don't forget to Clap & Follow for more.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Playing with pandas — Part 1

1000x faster data manipulation : vectorizing with Pandas and Numpy— A Summary

Keyhub is now in public beta — try out Certificate Lifecycle Management on autopilot

Flash Player End of Era

Skills required to become a Frontend Developer

Dopamine-driven development

How Long Does It Take To Migrate To Magento 2.3.x?

Easier way to do HTTPS hosting [Nginx + ASP.NET Core Docker]

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Decoded Bytes

Decoded Bytes

More from Medium

Install Kubernetes with Minikube in Apple M1

The Kubernetes’ Open-Source Tools to Check out in 2022

Install cert-manager to setup SSL with Let’s Encrypt and Cloudflare DNS with automatic renewal…

RKE Version Upgrade