AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,400 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of 8 Ansible books published by Apress and Leanpub including "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example", and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Install Red Hat OpenShift Local Kubernetes in macOS on MacBook Pro Intel x86_64 and M1 arm64

By Luca Berton · Published 2024-01-01 · Category: installation

How to install Red Hat OpenShift Local Kubernetes (formerly CodeReady Containers) to run a complete OpenShift 4 cluster in your Mac (Intel Chip x86_64 or Apple.

Install Red Hat OpenShift Local Kubernetes in macOS on MacBook Pro Intel x86_64 and M1 arm64

What is Red Hat OpenShift Local

• an OpenShift 4 cluster for local development • minimum 4 vCPU, 8 GB RAM, 35 GB storage • formerly CodeReady Containers

OpenShift Local is designed for local development and testing on an OpenShift 4 cluster. The OpenShift Local requires at least: • 4 virtual CPUs (vCPUs) • 8 GB of RAM memory • 35 GB of storage space

## Playbook

How to Install Red Hat OpenShift Local in MacOS and simple usage. • Red Hat OpenShift 4 on your laptop: Introducing Red Hat CodeReady Containers

Red Hat OpenShift Local website Red Hat OpenShift Local download Red Hat OpenShift Local macOS installer

cluster setup

ansible-pilot $ crc setup
CRC is constantly improving and we would like to know more about usage (more details at https://developers.redhat.com/article/tool-data-collection)
Your preference can be changed manually if desired using 'crc config set consent-telemetry <yes/no>'
Would you like to contribute anonymous usage statistics? [y/N]: y
Thanks for helping us! You can disable telemetry with the command 'crc config set consent-telemetry no'.
INFO Using bundle path /Users/lberton/.crc/cache/crc_vfkit_4.11.3_arm64.crcbundle 
INFO Checking if running as non-root              
INFO Checking if crc-admin-helper executable is cached 
INFO Checking for obsolete admin-helper executable 
INFO Checking if running on a supported CPU architecture 
INFO Checking minimum RAM requirements            
INFO Checking if crc executable symlink exists    
INFO Creating symlink for crc executable          
INFO Checking if running emulated on a M1 CPU     
INFO Checking if vfkit is installed               
INFO Checking if CRC bundle is extracted in '$HOME/.crc' 
INFO Checking if /Users/lberton/.crc/cache/crc_vfkit_4.11.3_arm64.crcbundle exists 
INFO Getting bundle for the CRC executable        
3.09 GiB / 3.09 GiB [--------------------------------------------------------------------] 100.00% 2.84 MiB p/s
INFO Uncompressing /Users/lberton/.crc/cache/crc_vfkit_4.11.3_arm64.crcbundle 
crc.img: 31.00 GiB / 31.00 GiB [----------------------------------------------------------------------] 100.00%
INFO Checking if old launchd config for tray and/or daemon exists 
INFO Checking if crc daemon plist file is present and loaded 
INFO Adding crc daemon plist file and loading it  
Your system is correctly setup for using CRC. Use 'crc start' to start the instance
ansible-pilot $

cluster start

ansible-pilot $ crc start
INFO Checking if running as non-root              
INFO Checking if crc-admin-helper executable is cached 
INFO Checking for obsolete admin-helper executable 
INFO Checking if running on a supported CPU architecture 
INFO Checking minimum RAM requirements            
INFO Checking if crc executable symlink exists    
INFO Checking if running emulated on a M1 CPU     
INFO Checking if vfkit is installed               
INFO Checking if old launchd config for tray and/or daemon exists 
INFO Checking if crc daemon plist file is present and loaded 
INFO Loading bundle: crc_vfkit_4.11.3_arm64...    
INFO Starting CRC VM for openshift 4.11.3...      
INFO CRC instance is running with IP 127.0.0.1    
INFO CRC VM is running                            
INFO Configuring shared directories               
INFO Check internal and public DNS query...       
INFO Check DNS query from host...                 
INFO Verifying validity of the kubelet certificates... 
INFO Starting kubelet service                     
INFO Waiting for kube-apiserver availability... [takes around 2min] 
INFO Waiting for user\'s pull secret part of instance disk... 
INFO Starting openshift instance... [waiting for the cluster to stabilize] 
INFO Adding crc-admin and crc-developer contexts to kubeconfig... 
Started the OpenShift cluster.
The server is accessible via web console at:
  https://console-openshift-console.apps-crc.testing
Log in as administrator:
  Username: kubeadmin
  Password: zc3Qx-ejEii-KALgK-5pbYU
Log in as user:
  Username: developer
  Password: developer
Use the 'oc' command line interface:
  $ eval $(crc oc-env)
  $ oc login -u developer https://api.crc.testing:6443
ansible-pilot $

cluster status

ansible-pilot $ oc status
CRC VM:          Running
OpenShift:       Degraded (v4.11.3)
Podman:          
Disk Usage:      16.39GB of 32.74GB (Inside the CRC VM)
Cache Usage:     36.85GB
ansible-pilot $

cluster WebUI

The server is accessible via web console at: https://console-openshift-console.apps-crc.testing

Red Hat CodeReady Containers webui

cluster stop

ansible-pilot $ crc stop
INFO Stopping kubelet and all containers...       
INFO Updating kernel args...                      
INFO Stopping the instance, this may take a few minutes... 
Stopped the instance
ansible-pilot $ crc status
CRC VM:          Stopped
OpenShift:       Stopped (v4.11.3)
Podman:          
Disk Usage:      0B of 0B (Inside the CRC VM)
Cache Usage:     36.85GB
Cache Directory: /Users/lberton/.crc/cache
ansible-pilot $

cluster restart

ansible-pilot $ crc stop
INFO Stopping kubelet and all containers...       
INFO Updating kernel args...                      
INFO Stopping the instance, this may take a few minutes... 
Stopped the instance
ansible-pilot $ crc status
CRC VM:          Stopped
OpenShift:       Stopped (v4.11.3)
Podman:          
Disk Usage:      0B of 0B (Inside the CRC VM)
Cache Usage:     36.85GB
Cache Directory: /Users/lberton/.crc/cache
ansible-pilot $ crc start
INFO Checking if running as non-root              
INFO Checking if crc-admin-helper executable is cached 
INFO Checking for obsolete admin-helper executable 
INFO Checking if running on a supported CPU architecture 
INFO Checking minimum RAM requirements            
INFO Checking if crc executable symlink exists    
INFO Checking if running emulated on a M1 CPU     
INFO Checking if vfkit is installed               
INFO Checking if old launchd config for tray and/or daemon exists 
INFO Checking if crc daemon plist file is present and loaded 
INFO Loading bundle: crc_vfkit_4.11.3_arm64...    
INFO Starting CRC VM for openshift 4.11.3...      
INFO CRC instance is running with IP 127.0.0.1    
INFO CRC VM is running                            
INFO Configuring shared directories               
INFO Check internal and public DNS query...       
INFO Check DNS query from host...                 
INFO Verifying validity of the kubelet certificates... 
INFO Starting kubelet service                     
INFO Waiting for kube-apiserver availability... [takes around 2min] 
INFO Waiting for user\'s pull secret part of instance disk... 
INFO Starting openshift instance... [waiting for the cluster to stabilize] 
INFO Adding crc-admin and crc-developer contexts to kubeconfig... 
Started the OpenShift cluster.
The server is accessible via web console at:
  https://console-openshift-console.apps-crc.testing
Log in as administrator:
  Username: kubeadmin
  Password: zc3Qx-ejEii-KALgK-5pbYU
Log in as user:
  Username: developer
  Password: developer
Use the 'oc' command line interface:
  $ eval $(crc oc-env)
  $ oc login -u developer https://api.crc.testing:6443
ansible-pilot $ crc status
CRC VM:          Running
OpenShift:       Degraded (v4.11.3)
Podman:          
Disk Usage:      16.39GB of 32.74GB (Inside the CRC VM)
Cache Usage:     36.85GB
Cache Directory: /Users/lberton/.crc/cache

See also: Install Red Hat CodeReady Containers to run OpenShift 4 in macOS

Conclusion

Now you know how to install Red Hat OpenShift Local (formerly CodeReady Containers) in macOS and how to manage the OpenShifft 4 cluster, start, stop, restart, and status.

Category: installation

Watch the video: Install Red Hat OpenShift Local Kubernetes in macOS on MacBook Pro Intel x86_64 and M1 arm64 — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home