Skip to main content

Install-MicroK8s-on-Linux

[[Command]] [[Linux]]

Install MicroK8s on Linux

sudo snap install microk8s --classic

Don’t have the snap command? Get set for snaps Add your user to the microk8s admin group

MicroK8s creates a group to enable seamless usage of commands which require admin privilege. Use the following commands to join the group:

sudo usermod -a -G microk8s $USER

sudo chown -f -R $USER ~/.kube

You will also need to re-enter the session for the group update to take place:

su - $USER

Check the status while Kubernetes starts

microk8s status --wait-ready

Turn on the services you want

microk8s enable dashboard dns ingress

Try microk8s enable --help for a list of available services and optional features. microk8s disable ‹name› turns off a service. Start using Kubernetes

microk8s kubectl get all --all-namespaces

If you mainly use MicroK8s you can make our kubectl the default one on your command-line with alias mkctl=”microk8s kubectl”. Since it is a standard upstream kubectl, you can also drive other Kubernetes clusters with it by pointing to the respective kubeconfig file via the “--kubeconfig” argument. Access the Kubernetes dashboard

microk8s dashboard-proxy

Start and stop Kubernetes to save battery

Kubernetes is a collection of system services that talk to each other all the time. If you don’t need them running in the background then you will save battery by stopping them. microk8s start and microk8s stop will do the work for you