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:
Install MicroK8s on Linux
sudo snap install microk8s --classic
Check the status while Kubernetes starts
microk8s status --wait-ready
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.
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
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.
To enable microk8s again: