Back
Featured image of post How to run minikube on an Apple Silicon M1

How to run minikube on an Apple Silicon M1

Many people might be wondering if it’s possible to run k8s locally on the new Mac computers with Apple Silicon. The short answer is yes, it is possible. Here i will show you how i managed to get it done.

Note: I’m writing this on February 8th, 2021. As more support keeps coming for the new chips, this will be easier to do in the near future.

Docker

The first thing we need is to download the Apple M1 tech preview build:

https://docs.docker.com/docker-for-mac/apple-m1/

Just follow the instalation process and try to start it. If you are lucky enough, it will work just fine. If docker hangs during the startup, try to open the console.log and follow this steps:

  1. Open /Library/preferences/SystemConfiguration/com.apple.vmnet.plist. You will see something like this:

     <key>Shared_Net_Address</key>
     <string>192.168.64.1</string>
     <key>Shared_Net_Mask</key>
     <string>255.255.255.0</string>
    
  2. On my console log, i saw that docker was starting but it was expecting some services on the 192.168.65.x network. By reading some github threads, i changed the file specified on the previous step and, in my case, had to be changed to 192.168.65.1. After opening Docker again, it worked like a charm.

Ok so now we have docker preview up and running 👌

Docker running!
Docker running!

Minikube

After a little research, i also found an open thread for minikube. You can see it here: https://github.com/kubernetes/minikube/issues/9224

Here are the steps to follow:

  1. Download the minikube-darwin-arm64 file. You can find it on the previous link i shared or in here: https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-arm64

  2. Let’s make it executable:

     chmod +x minikube-darwin-arm64
    
  3. Now we can rename it:

     mv minikube-darwin-arm64 minikube
    
  4. Move it to your $PATH:

     sudo mv minikube /usr/local/bin/
    

Ok so after following this steps, you should be able to start minikube. In my case though, it failed a couple of times until i specified the driver “which is the only one supported for the moment”.

    minikube start --driver=docker --alsologtostderr

After this, i could start using minikube without any issues. I also tested Terraform to create some resources and worked very well.

K8s running on a Macbook Air M1
K8s running on a Macbook Air M1

If you have any questions, feel free to ask in the comments section.

comments powered by Disqus
Built with Hugo
Theme Stack