Install MicroK8s Kubernetes Cluster on Mac M1 using Multipass (Ubuntu VM)
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