Install Microk8s on Ubuntu#


Microk8s works better for production than it does for development and debugging. If you’re using an Ubuntu VM for you dev environment I recommend starting with Minikube instead.

Microk8s is a Kubernetes (K8s) distribution for Ubuntu (though it also run on Windows and Mac). It’s a good way to run Kubernetes locally on your own machine or in production on a cluster.

These are the instructions for getting Microk8s running on an Ubuntu VM:

  1. Install MicroK8s on Linux

    sudo snap install microk8s --classic
  2. Check the status while Kubernetes starts

    microk8s status --wait-ready
  3. Turn on the services you want

    microk8s enable dashboard dns registry

    Try microk8s enable –help for a list of available services and optional features. microk8s disable <name> turns off a service.

  4. 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.

  5. Access the Kubernetes dashboard

    microk8s dashboard-proxy
  6. 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 stop

    To enable microk8s again:

    microk8s start