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 sometime 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, having more resources at our disposal is better to ensure there is no resource shortage and disruptions when it runs. My laptop has 16 GB RAM, 8 cores, and 16 logical processors.

OS requirement

For running CRC on 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

To install 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 the OpenShift code-ready container and copy the secret.
  • 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 can 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, microshift 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 use the default presets as an openshift container platform. It’ll run a complete OpenShift cluster environment as a single node, providing a registry and access to the Operator. We can view the preset by running the following command.

We can change our preference of preset by using the following command. For example, to use podman as the preset, we can run this command:

Setup and start CRC

  • To set up the CRC, run the following command: crc setup. It will take a while for the first time, to download heavy files to proceed with the setup process.
  • Now, issue the following command to start crc and supply the secret when prompted:

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

Setup to 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

Stopping the CRC instance

We can run the following command to stop the locally installed OpenShift and container runtime: crc stop

Deleting the CRC instance

We can run the following command to delete the Red Hat Openshift Local Instance: crc delete

Reference

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

130

No Responses

Write a response

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