How to Install Kubernetes on Ubuntu 18.04 Bionic Beaver
MicroK8s is built to run on any Linux. It’s lightweight and deploys all Kubernetes services natively on Ubuntu (i.e. no virtual machines required) while packing the entire set of libraries and binaries needed. It’s suited for laptops, workstations, CI pipelines, IoT devices, and small edge clouds because of its small footprint. MicroK8s is packaged as a snap which requires snapd to be installed. The latest Ubuntu release comes with this already built in. For other Linux systems install snapd first. Use this command to get the latest version of MicroK8s:
Step 1 : Install latest MicroK8s
sudo snap install microk8s --classic
Step 2 : Install specific versions of MicroK8s
The following command will list all versions of MicroK8s that can be installed:snap info microk8s
This command will install the stable 1.14 version of MicroK8s:
sudo apt-get remove docker docker-engine docker.io
Step 3 : Additional Setup
After installing MicroK8s, you should verify it is ready. Use this command:microk8s.status
To block until MicroK8s is ready, use the following command:
microk8s.status --wait-ready
Accessing Kubernetes: MicroK8s embeds a kubectl and a .kubeconfig file required for accessing the installed MicroK8s. This avoids colliding with any local versions that might be already installed. Here is an example of how to use this:
microk8s.kubectl
If you would like to use the MicroK8s kubectl and .kubeconfig file locally, you can do the following:
snap alias microk8s.kubectl kubectl
microk8s.kubectl config view --raw > $HOME/.kube/config