top of page

How to Install Kubernetes in Apple Mac M Chip

Sep 2, 2024

2 min read

0

54

In this blog post, I will explain the most efficient method How to Install Kubernetes in Apple Mac M Chip based on my experience. I've tried Kubernetes on Docker, and Minikube but I always encounter issues. In my opinion, utilizing Rancher Kubernetes Desktop is the most straightforward approach. Here is an overview of the necessary steps.


  1. Install Docker

  2. Install Home Brew

  3. Install Rancher Desktop

  4. Install Kubectl

  5. Test Kubernetes



Install Kubernetes in Apple Mac M
Install Kubernetes in Apple Mac M

Step 1: Install Docker

  1. Download Docker image installer in their official website.

  2. Install the Docker package that you've downloaded. See video below.




Step 2: Install Homebrew

Homebrew or simply brew is a Mac package manager. Having this tool allows you to easily install packages in Mac command line and its dependencies. The step by step guide can be found in their web site. In case you needed assistance, here is the video.


  1. Install Xcode. Download Xcode in this link.

  2. Install Homebrew. See video below or you may run this command in your Mac terminal:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"



Step 3: Install Rancher Kubernetes Desktop


  1. Download Rancher Kubernetes Desktop for Mac here. Make sure to choose Apple Silicon chipset.

  2. Install Rancher Kubernetes Desktop. See video installation below.




Step 4: Install Kubectl


  1. Go to the official Kubernetes website for installation guide of kubectl. You may follow my installation command below which is the same.


Option 1: Using Brew

Install using brew.

# brew install kubectl

Option 2: Using Curl


Download the latest release.

 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"

Download the checksum file.

 curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl.sha256"

Validate the kubectl binary against the checksum file.

echo "$(cat kubectl.sha256)  kubectl" | shasum -a 256 --check

The output should show ok.

kubectl: OK

Step 5: Test Kubernetes


Check kubectl version

If this command run successfully. You must likely have a successful installation.

$ kubectl version
kubectl version
kubectl version

Launch HTTPD Pod

Below is the command to launch sample HTTPD pod. Attached also is the video for the complete command and viewing of pod.


Launch a HTTPD pod

$ kubectl run httpd --image=httpd

Check pod status

$ kubectl get pods

Here is the complete video demo.


Conclusion: Install Kubernetes in Apple Mac M Chip

Here is the comprehensive guide for installing Kubernetes on an Apple Mac with an M Chip. If you already have Kubernetes installed on your Mac, you might need to remove the old .kube folder and then restart Rancher if you encounter a connection error. If you have any questions or face any issues, please don't hesitate to contact us or leave a comment on the post. In our upcoming blog post, we will publish an article that distinguishes between containers, pods, deployments, and services. Additionally, we will provide a demonstration.



bottom of page