microk8s installation notes

  • tested on ubuntu 18.04
  • not suitable for production use.

Software installation

Adapted from ubuntu documentation

sudo snap install microk8s --classic --channel 1.23/stable

grant admin access to non-root user:

mkdir ~/.kube
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
sudo microk8s config > ~/.kube/config
💡
Continue in a new session for the above group permissions to apply

enable add-ons

microk8s enable dns dashboard storage

expose dashboard as a nodeport:

microk8s kubectl expose \
  -n kube-system deployment   kubernetes-dashboard \
  --type=NodePort --name=kubernetes-dashboard-np
  
  
# find the external port:
microk8s kubectl get service -n kube-system kubernetes-dashboard-np

get secret & login to dashboard

it's a long, ugly string:

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

... now we can login to the host via the nodeport service

Uninstall & Remove data

microk8s reset