Sunday, 26 October 2025

Install OpenShift Locally: Single-Node Cluster Setup with CodeReady Containers (CRC)

Our course you can check :-   Udemy course 


Here’s the step-by-step guide to install OpenShift locally with full admin access using CodeReady Containers (CRC) on a Windows laptop:


1. Check System Requirements

  • OS: Windows 10 or 11 (64-bit).
  • CPU: 4 cores minimum.
  • RAM: 9 GB minimum (16 GB recommended).
  • Disk: 35 GB free space.
  • Virtualization: Enabled in BIOS.
  • Hyper-V: Must be enabled (or use WSL2).

2. Enable Virtualization & Hyper-V

  1. Enable Virtualization in BIOS:
    • Restart → Enter BIOS → Enable Intel VT-x or AMD-V.
  2. Enable Hyper-V in Windows:
    • Open PowerShell as Administrator:
      dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
    • Restart your system.

3. Download CRC

  • Go to: Red Hat CRC Download
  • Login with your Red Hat account (free to create).
  • Download:
    • CRC Windows installer (ZIP).
    • Pull secret (JSON file).

4. Install CRC

  1. Extract the ZIP file.
  2. Move crc.exe to a folder (e.g., C:\crc).
  3. Add this folder to your PATH:
    • Search Environment Variables → Edit PATH → Add C:\crc.

5. Setup CRC

Open Command Prompt or PowerShell and run:

crc setup

This configures networking and Hyper-V for CRC.


6. Start the Cluster

Run:

crc start -p C:\path\to\pull-secret.json

  • This will:
    • Create a local OpenShift cluster.
    • Print login credentials and console URL.

7. Access the Cluster

  • Web Console: Use the URL shown after crc start (usually https://console-openshift-console.apps-crc.testing).
  • Login: Use:
    • developer (normal user).
    • kubeadmin (full cluster-admin access).

8. CLI Access

Login with oc:

crc oc-env

Copy the output and run it in PowerShell to set environment variables, then:

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


9. Verify Admin Access

oc whoami
oc get nodes
oc get clusterrolebinding

You should see full access.


10. Common Admin Tasks

  • Create a project: oc new-project myproject
  • Deploy an app:
    oc new-app nginx
    oc expose svc nginx

🔥 Tips

  • CRC runs a single-node OpenShift cluster.
  • Use crc stop and crc delete to manage resources.
  • Keep your laptop plugged in (CRC is resource-heavy).


>>>> Delete cluster after work done to save resources of laptop:-

Here’s the step-by-step guide to completely uninstall OpenShift CodeReady Containers (CRC) on a Windows laptop:


1. Stop the CRC Cluster

Open PowerShell or Command Prompt and run:

crc stop

This stops the running OpenShift cluster.


2. Delete the CRC Instance

Remove the local OpenShift VM and cluster data:

crc delete


3. Cleanup CRC Configuration

Run:

crc cleanup

This removes network configurations, DNS entries, and other CRC-related settings.


4. Remove CRC Executable

  • Navigate to the folder where you placed crc.exe (e.g., C:\crc).
  • Delete crc.exe.
  • Remove the folder from your PATH:
    • Search Environment Variables → Edit PATH → Remove C:\crc.

5. Delete CRC Cache and Config Files

Remove CRC directories:

  • Open File Explorer and delete: %USERPROFILE%.crc

This contains cached images and configuration.


6. Remove Pull Secret (Optional)

Delete the pull secret JSON file you downloaded earlier if you want a clean uninstall.


7. Verify Uninstallation

Run:

crc version

If CRC is removed, you’ll see:

'crc' is not recognized as an internal or external command

🔥 Extra Cleanup (Optional)

  • Remove any leftover Hyper-V virtual machine named crc.
    • Open Hyper-V Manager → Delete crc VM.
  • Restart your system to ensure all changes apply.


Conclusion:-

Want to run OpenShift on your laptop without the complexity of a full cluster? This course shows you how to install a single-node OpenShift cluster using CodeReady Containers (CRC)—perfect for developers, DevOps engineers, and SREs who want a local OpenShift environment for testing and learning.

In this hands-on course, you'll learn:

  • How to download and install CRC on Linux, Windows, or macOS
  • How to configure your system and start the OpenShift cluster
  • How to use the oc CLI and OpenShift web console
  • How to deploy sample applications locally
  • How to troubleshoot common CRC issues

By the end of this course, you'll have a fully functional OpenShift cluster running on your machine—ideal for development, experimentation, and learning OpenShift fundamentals.

No comments:

Post a Comment