Red Hat Openshift Local

Install Red Hat OpenShift Local (CodeReady Container) on windows laptop

In this article, I will share how you can install Red Hat OpenShift Local (formerly CodeReady Container) on a windows laptop. Openshift is a popular cloud platform these days. Red Hat Openshift introduced Red Hat OpenShift Local, enabling us to install and spin up a minimal and per-configured version of OpenShift v4.1 (or newer) on our local laptop for development and testing purposes. It was known as CodeReady Container earlier.

MiniShift vs. Red Hat OpenShift Local

I wrote a tutorial on installing MiniShift in the local system sometimes back. Let me briefly discuss the difference between MiniShift and Red Hat Openshift Local. MiniShift helped us run OKD 3.11(OpenShift community/open-source edition v3.11) in our local system.

Red Hat OpenShift Local lets us install and run OpenShift version 4.1 (or newer) cluster in our local system.

Our focus here is on Redhat OpenShift CodeReady Container. Let’s proceed.

Prerequisite to install Red Hat OpenShift Local

Hardware requirement

It needs a minimum of 4 core CPUs, 9 GB of free RAM, and 35 GB of storage space. However, it’s better to have more resources at our disposal to ensure there is no resource shortage and disruptions when it runs. My current laptop has 16 GB RAM, 8 cores, and 16 logical processors.

OS requirement

For running CRC in Windows machines, use Windows 10 Fall Creators Update (v 1709) or newer. In my case, I am using Windows 11 Pro.

Hypervisor

The system should be capable of virtualization. Please don’t install it in a VM as there can be an issue of nested virtualization. In my case, I’ll use the native hypervisor (Hyper-V) of Windows. To ensure that Hyper-V is enabled, please go to “Control Panel” -> “Programs” -> “Turn Windows Features on or off.”. A window will pop up. Check the Hyper-V checkbox and restart the machine.

Registration/Login

For installing the Red Hat OpenShift Local, you must have a Red Hat account. You can create it free of cost. If you already have an account, head to https://developers.redhat.com/products/codeready-containers/overview and click on the “Install OpenShift on your laptop” button. It’ll redirect you to the login page if you have not already logged in. Key in your credential and log in.

Please check the official page for minimum system requirement.

https://access.redhat.com/documentation/en-us/red_hat_openshift_local/2.2/html/getting_started_guide/installation_gsg#minimum-system-requirements_gsg

Download & Install

  • Once logged in, ensure to select the appropriate OS. In this article, I am demonstrating with Windows. Click on the “Download CodeReady Containers” button.
  • Also, click the “Download pull secret” button to download the pull secret that we’ll use later.
download OpenShift code ready container
download OpenShift code-ready container
  • Extract the content of the zip file in any folder
  • Double click on the crc-windows-amd64.msi file to launch the installation wizard.
  • Follow the simple wizard and install the Code Ready Container platform in your system.
  • Now open a command prompt & issue the following command to check the version of the CodeReady container and which version of the OpenShift cluster it will spin up after we set it up.

Usage Data Collection Settings

You have the choice to give consent or deny sharing optional usage data collection with Red Hat. This data helps them make the platform better.

  • Use the following command to give consent to share usage data.
  • Use the following command to disable sharing the usage data.
  • At any point, to check what you have already configured, run the following command:
  • Please note that we’ll also see this same setting below when we do the setup of CRC.

Know about Red Hat OpenShift Local presets

Before we start with setting up the Red Hat OpenShift Local, let’s take a look at what presets are:

In Red Hat OpenShift Local, presets represent a managed container runtime and the lower bounds of system resources required by the instance to run it. It offers presets for OpenShift Container Platform and the Podman container runtime.

https://access.redhat.com/documentation/en-us/red_hat_openshift_local/2.2/html/getting_started_guide/using_gsg

In this tutorial, we’ll select the presets as OpenShift Container Platform. The other option is to use the podman. If we choose, OpenShift preset, It’ll run a complete OpenShift cluster environment as a single node, providing a registry and access to Operator HubPodman

Setup CRC

  • Now, from the Start menu, search for Red Hat Openshhift Local. Click on it.
Red Hat OIpenshift Local
Red Hat OIpenshift Local
  • Red Hat OpenShift Local setup wizard will open. Click on Get started button.
  • Choose the preset you want to use. As mentioned in the previous section, I’ll select OpenShift. Click on the Next button.
  • Please copy and paste the pull secret that we have downloaded previously in this wizard section. Click on the Next button.
  • In the last screen of the wizard, we’ll review our choices made so far. On this screen, we also can select whether to send usage data to Red Hat or not (we explored this in the previous section). Click on the Run Setup button.
Red Hat OpenShift Local Setup Overview
Red Hat OpenShift Local Setup Overview
  • The setup process takes a long time. Once done, you will see a screen like the one below.
Red Hat OpenShift Local Setup Completion
Red Hat OpenShift Local Setup Completion
  • Click on the Start using button. The wizard will disappear. You will notice an icon will appear on the system tray.

Start CRC

  • Now, let’s spin up the local Redhat Openshift cluster.
  • From the System Tray, click on the icon of Red Hat OpenShift7 Local and click on Start [Refer to th9e image below]
Start CRC
Start CRC
  • It’ll begin to start th6e cluster. You can click on the Open logs menu item to view the execution logs.
  • If you have installed antivirus in the system, it may block firewall access. Allow it when it pops up in any window for access to the required network.
  • It may take a while to start for the first time. Have patience!
  • Optionally, you can run the crc start command from the command prompt.

Credentials for OpenShift CRC

To obtain the credentials for the OpenShift cluster we just started, open a terminal and issue the crc console –credentials command.

Access OpenShift Web Console

  • As another additional method, you can click on the System Tray, click on the CodeReady Containers icon and click on the Open Console icon. It will open the web console in your default web browser.
OpenShidt CRC access the web console

Setup tp use OC command

oc is a powerful command-line tool we can use to create applications and manage the OpenShift cluster. The oc CLI tool automatically gets installed during our installation/setup process. We need to add the location of this tool in the PATH so that we can use it seamlessly from the command prompt.

  • Launch the command prompt and issue crc oc-env command
  • Next, run the printed command above
  • Now, you can easily manage the OpenShift cluster using the CLI. For example, execute the following command to log in to the Red Hat OpenShift Local cluster:
  • Once successfully logged in, you can use the oc command for various interactions with the OpenShift cluster

Reference

https://developers.redhat.com/products/openshift-local/overview?source=sso

56

No Responses

Write a response

This site uses Akismet to reduce spam. Learn how your comment data is processed.