Introduction
OpenShift 4 stands as a leading enterprise-grade container orchestration platform, ensuring your application containers run smoothly with advanced features. Installing OpenShift 4 on ARM architecture-based machines like Apple Silicon MacBooks, however, presents unique challenges. This guide will walk you through the process of installing an OpenShift 4 Single Node OpenShift (SNO) ARM-based cluster on an M1 Pro MacBook.
Prerequisites
- VMware Fusion Pro Installation: Before you start, ensure VMware Fusion Pro is installed on your Mac. If you need detailed steps, refer to our previous post titled VMware Fusion Pro for Apple Silicon for Free.
- Custom DNS Server for VMware Fusion: For VMware Fusion’s DHCP configuration, a custom DNS server must be in place to answer DNS queries for the OpenShift cluster API URL. Check our previous post titled Custom DNS Nameserver IP for VMware Fusion Pro Networks for detailed steps.
- Podman: Podman is crucial for creating the final ISO for the SNO cluster virtual machine. We’ll guide you through the Podman installation in the upcoming steps.
Important Links
- Official OpenShift 4 SNO Cluster Installation Documentation
- OpenShift Client for Mac ARM64
- OpenShift Installer for Mac ARM64
- OCP 4 Pull Secret
Installation Details
The base domain used in this installation is example.com, and the cluster name is ayush. This setup will generate a cluster API URL: api.ayush.example.com. Feel free to customize the domain and cluster name as per your preference. Ensure you download the oc and openshift-install binaries from the links provided, as the official documentation primarily offers Linux x86_64 binaries.
Start the Installation!
Video Tutorial for Better Understanding
For those who prefer a visual learning experience, we have a comprehensive video tutorial available on YouTube. The video walks you through each step of installing the OpenShift 4 SNO cluster on an M1 MacBook, from the initial setup to accessing the cluster. This resource is invaluable for those who want to see the process in action.
- Begin by installing the Homebrew package manager on your Mac. Once installed, use it to install and configure Podman, which will help you generate the required ISO for the SNO cluster.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"$ brew install podman$ podman machine init$ podman machine start
- Ensure your DNS server is correctly configured to answer the DNS query for your cluster API URL (e.g.,
api.<cluster-name>.<base-domain>). Also, configure the reverse lookup so that the virtual machine hostname is set up automatically. The links provided in the prerequisites section offer detailed guidance on this configuration.
// The DNS server must be configured to answer the dns queries for - api.<cluster-name>.<base-domain> - api-int.<cluster-name>.<base-domain> - *.apps.<cluster-name>.<base-domain> i.e. the forward dns lookup. The reverse dns lookup also needs to be configured so that the VM can get a hostname.// Forward Zone$ cat /etc/dnsmasq.confuser=dnsmasqgroup=dnsmasqinterface=ens160listen-address=::1,127.0.0.1,192.168.117.129local-service=hostexpand-hostsdomain=example.comserver=8.8.8.8server=8.8.4.4address=/api.ayush.example.com/192.168.117.131address=/api-int.ayush.example.com/192.168.117.131address=/.apps.ayush.example.com/192.168.117.131conf-dir=/etc/dnsmasq.d,.rpmnew,.rpmsave,.rpmorig// Reverse Zone$ cat /etc/hosts192.168.117.131 api.ayush.example.com// Verify the DNS resolution.$ nslookup api.ayush.example.comServer: 127.0.0.1Address: 127.0.0.1#53Name: api.ayush.example.comAddress: 192.168.117.131$ nslookup api-int.ayush.example.com 192.168.117.129Server: 192.168.117.129Address: 192.168.117.129#53Name: api-int.ayush.example.comAddress: 192.168.117.131$ nslookup test.apps.ayush.example.comServer: 192.168.117.129Address: 192.168.117.129#53Name: test.apps.ayush.example.comAddress: 192.168.117.131$ nslookup 192.168.117.131131.117.168.192.in-addr.arpa name = api.ayush.example.com.
- On your Apple Silicon MacBook, create a new directory and follow the steps to generate the SNO cluster VM ISO.
$ mkdir SNO-OCP$ cd SNO-OCP// Export the environment variables with correct details to download the required binaries.$ OCP_VERSION=latest-4.16$ ARCH=aarch64// Download the oc client TAR file, extract the contents and verify the oc binary version.$ curl -k https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/$OCP_VERSION/openshift-client-mac-arm64.tar.gz -o oc.tar.gz$ tar zxf oc.tar.gz && rm -rf kubectl oc.tar.gz README.md$ chmod +x oc$ ./oc versionClient Version: 4.16.8Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3// Download the openshift-install TAR file, extract the contents and verify the version and architecture.$ curl -k https://mirror.openshift.com/pub/openshift-v4/aarch64/clients/ocp/$OCP_VERSION/openshift-install-mac-arm64.tar.gz -o openshift-install-mac.tar.gz$ tar zxf openshift-install-mac.tar.gz && rm -rf openshift-install-mac.tar.gz README.md$ chmod +x openshift-install$ ./openshift-install version./openshift-install 4.16.8built from commit 4f78aec1c86c5f51f560f56193f7be1843ab2cd2release image quay.io/openshift-release-dev/ocp-release@sha256:0a99ef4f95dee2d0f4865e32bb8e9649a7f7b0241a7d7312200f39d1a0120e9drelease architecture arm64// Download the ISO file.$ ISO_URL=$(./openshift-install coreos print-stream-json | grep location | grep $ARCH | grep iso | cut -d\" -f4)$ curl -L $ISO_URL -o rhcos-live.iso// Create the install-config.yaml file and specify the correct values for baseDomain, cluster name, installationDisk, pullSecret and sshKey.$ vi install-config.yamlapiVersion: v1baseDomain: example.comcompute:- name: worker replicas: 0controlPlane: name: master replicas: 1metadata: name: ayushnetworking: clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 machineNetwork: - cidr: 10.0.0.0/16 networkType: OVNKubernetes serviceNetwork: - 172.30.0.0/16platform: none: {}bootstrapInPlace: installationDisk: /dev/disk/by-id/<disk_id> pullSecret: '<pull_secret>' sshKey: | <ssh_key>// Generate the ignition for SNO and embed it to the previously downloaded the ISO file.$ mkdir ocp$ cp install-config.yaml ocp$ ./openshift-install --dir=ocp create single-node-ignition-config$ alias coreos-installer='podman run --privileged --pull always --rm -v /dev:/dev -v /run/udev:/run/udev -v $PWD:/data -w /data quay.io/coreos/coreos-installer:release'$ coreos-installer iso ignition embed -fi ocp/bootstrap-in-place-for-live-iso.ign rhcos-live.iso
- Then, create a virtual machine using the
rhcos-live.iso, allocating at least 16 GB of memory, 4 processor cores, and 50 GB of disk storage, based on the Red Hat Enterprise Linux 9 64-bit ARM operating system. - Allow 40-45 minutes for the cluster installation to complete. Be patient; this step takes time.
- To interact with the cluster using the
occommand from your Mac, add the necessary entries in the/etc/hostsfile for the cluster API URL, console, and OAuth routes, all pointing to the SNO virtual machine’s IP address.
$ cat /etc/hosts##192.168.117.131 api.ayush.example.com192.168.117.131 console-openshift-console.apps.ayush.example.com 192.168.117.131 oauth-openshift.apps.ayush.example.com
- Finally, the cluster can be accessed from the CLI by exporting the kubeconfig file.
$ export KUBECONFIG=ocp/auth/kubeconfig$ ./oc get nodesNAME STATUS ROLES AGE VERSIONapi.ayush.example.com Ready control-plane,master,worker 6h4m v1.29.7+4510e9c$ ./oc get coNAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGEauthentication 4.16.8 True False False 5h16mbaremetal 4.16.8 True False False 5h33mcloud-controller-manager 4.16.8 True False False 5h30mcloud-credential 4.16.8 True False False 5h46mcluster-autoscaler 4.16.8 True False False 5h31mconfig-operator 4.16.8 True False False 5h34mconsole 4.16.8 True False False 5h16mcontrol-plane-machine-set 4.16.8 True False False 5h31mcsi-snapshot-controller 4.16.8 True False False 5h34mdns 4.16.8 True False False 5h31metcd 4.16.8 True False False 5h27mimage-registry 4.16.8 True False False 5h15mingress 4.16.8 True False False 5h33minsights 4.16.8 True False False 5h33mkube-apiserver 4.16.8 True False False 5h20mkube-controller-manager 4.16.8 True False False 5h19mkube-scheduler 4.16.8 True False False 5h30mkube-storage-version-migrator 4.16.8 True False False 5h34mmachine-api 4.16.8 True False False 5h30mmachine-approver 4.16.8 True False False 5h31mmachine-config 4.16.8 True False False 5h33mmarketplace 4.16.8 True False False 5h33mmonitoring 4.16.8 True False False 5h16mnetwork 4.16.8 True False False 5h34mnode-tuning 4.16.8 True False False 5h34mopenshift-apiserver 4.16.8 True False False 5h20mopenshift-controller-manager 4.16.8 True False False 5h18mopenshift-samples 4.16.8 True False False 5h15moperator-lifecycle-manager 4.16.8 True False False 5h33moperator-lifecycle-manager-catalog 4.16.8 True False False 5h31moperator-lifecycle-manager-packageserver 4.16.8 True False False 5h20mservice-ca 4.16.8 True False False 5h34mstorage 4.16.8 True False False 5h31m
- Access the OpenShift 4 web console via your browser using the console route located in the
openshift-consolenamespace. The username iskubeadmin, and the password can be found in theocp/auth/kubeadmin-passwordfile. - If requests to any public URLs from the pods on the cluster fail, such as the Insights Operator or an application pod pulling code from GitHub, then the
routingViaHostoption needs to be enabled in the cluster network configuration. During my troubleshooting, I identified that this issue occurs due to improper packet fragmentation.
$ oc patch network.operator/cluster --type merge -p '{"spec":{"defaultNetwork":{"ovnKubernetesConfig":{"gatewayConfig":{"routingViaHost":true}}}}}'
Conclusion
This guide covers the essential steps to install and access an OpenShift 4 SNO ARM cluster on an M1 MacBook. Follow the instructions carefully, and you’ll have your cluster up and running in no time. For a visual guide, check out the comprehensive video tutorial on YouTube.

Leave a Reply