Install OpenShift Local
Setting up a robust local development environment is crucial for developers working with containerized applications. OpenShift Local provides a streamlined, minimal OpenShift Container Platform 4 cluster that can run on your local machine. This guide will walk you through the process of setting up OpenShift Local on Windows 11 with Hyper-V, ensuring your system meets the necessary hardware requirements, configuring CRC (CodeReady Containers) with optimal resources, and setting up network access through an external switch. By the end of this tutorial, you will have a fully functional OpenShift environment ready for development and testing.
1. How to Get and Deploy OpenShift Local
- In order to download and install OpenShift Local you will need a Red Hat account. This is free. Sign up at https://developers.redhat.com/.
- Download OpenShift Local: Visit the Red Hat OpenShift Local download page and download the version for your OS. https://developers.redhat.com/products/openshift-local/overview Make sure you are on the local tab.
- Install CodeReady Containers (CRC): Extract the downloaded file.
- RUN: “crc setup” (Use Powershell)
- Pull Secret: During the install process, you will need to provide the pull secret.
2. How to Set Up CRC to Use 4 CPUs and 12GB of Memory
crc start --cpus 4 --memory 12288
- If you start you CRC with this, you will have to ALWAYS start it with this command.
3. How to Retrieve Users and Passwords After Setup
- Retrieve the Admin Credentials: Use the command “crc console” to access the OpenShift web console.
- Find the Admin User and Password: Look for the credentials in the console or use the command crc config view to view the current configuration, which includes the admin user and password. “crc config –credentials”
4. How to Change the Network in Hyper-V to Use the External Switch
- Open Hyper-V Manager: Go to the Hyper-V Manager.
- Select Your Virtual Machine: Right-click on the virtual machine running OpenShift Local and select “Settings.”
- Change Network Adapter: Under the “Hardware” tab, select the network adapter and click “Remove.”
- Add a New Network Adapter: Click “Add” and select the external switch you want to use.
- Restart the Virtual Machine: Restart the virtual machine to apply the changes.
Note on External switch: I have seen where the crc virtual machine does not allow connections to it when you start it up. If the 'crc start' is stuck:
1) exit the 'crc start'
2) do a 'crc stop'
3) edit the crc VM and remove the network adapter
4) do a 'crc start (with your aruguements for cpu and memory)'
5) when it is up, go back to the VM and add the external network adapter back in
5. Log into OpenShift Web Console
- Run: crc console, this will open the OpenShift Web UI in a browser
- Login: use the kubeadmin and password from the crc output to log in. See step 3 on how to retrieve the usernames and passwords if you did not copy the output.
- CLI access to OpenShift: In the upper right corner is your username. The drop down will give you access to your user preference and “Copy login Command”. The Copy Login Command will give you a token and the ‘oc’ command to login into the cluster from a command line.
6. Expand the Disk space.
You will need to expand the disk space if you are going to add any projects and pods.
- Shutodwn CRC VM: “crc stop”
- Open Hyper-V Manager: Launch Hyper-V Manager from the Start menu.
- Select Your VM: Right-click on your CRC VM and select Settings.
- Edit Virtual Hard Disk: In the Hardware section, select Hard Drive and click Edit.
- Expand Disk: In the Edit Virtual Hard Disk Wizard, select Expand and specify the new size for your virtual hard disk. Make it 100GB.
- Finish: Click Finish to apply the changes.
- Start the VM: “crc start” * if you started you orginial crc with crc start –cpus 6 –memory 12288, then start it with the arguments.
By following the detailed steps outlined in this guide, you can efficiently set up OpenShift Local on Windows 11 with Hyper-V, ensuring your system meets the necessary hardware requirements and configurations. From enabling Hyper-V and creating an external virtual switch to configuring CRC with the optimal resources and retrieving user credentials, this setup provides a robust foundation for your local development environment. With OpenShift Local up and running, you’re now ready to deploy and manage containerized applications, making full use of the powerful features OpenShift offers. Stay tuned for more advanced tutorials and projects that will take your development skills to the next level.

