Install MicroK8s Kubernetes Cluster on Mac M1 using Multipass (Ubuntu VM)

Puneeth Prakash
2 min readJun 19, 2024

--

Have a look at the following blog post to create an Ubuntu VM on Mac M1:

Step 1:

Install MicroK8s from snap store:

snap info microk8s gives information on the current published versions of MicroK8s.

sudo snap install microk8s --classic

Step 2:

Configure firewall to allow pod-pod and pod-internet communication:

sudo ufw allow in on cni0 && sudo ufw allow out on cni0

sudo ufw default allow routed

Step 3:

Add ubuntu user to ‘microk8s’ group:

sudo usermod -a -G microk8s ubuntu

newgrp microk8s

Step 4:

Enable Addons:

microk8s enable dns

microk8s enable dashboard

microk8s enable hostpath-storage

alias k=’microk8s kubectl’

k get all --all-namespaces

Wait for all resources to come to Running state.

You can access the dashboard using the IP and port of kubernetes-dashboard service in the kube-system namespace.

Open a browser and access https://<ClusterIP_of_Kubernetes-Dashboard_Service>:<port_of_Kubernetes-Dashboard_Service>

Retrieve the default token using the following command: (This is used to access the dashboard)

token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d “ “ -f1)

k -n kube-system describe secret $token

Other useful commands:

microk8s status

microk8s inspect

microk8s start

microk8s stop

microk8s version

--

--

Puneeth Prakash
Puneeth Prakash

Written by Puneeth Prakash

I work as a Subject Matter Expert in FMW at Oracle. This blogging space is to share my learning experiences. Views expressed here are solely my own.

No responses yet