MicroK8s is the smallest, fastest, fully-conformant Kubernetes that tracks upstream releases and makes clustering trivial. MicroK8s is great for offline development, prototyping, and testing. Use it on a VM as a small, cheap, reliable k8s for CI/CD. It’s also the best production grade Kubernetes for appliances. Develop IoT apps for k8s and deploy them to MicroK8s on your Linux boxes.
- An Ubuntu 20.04 LTS, 18.04 LTS or 16.04 LTS environment to run the commands (or another operating system which supports
snapd- see the snapd documentation)
- At least 20G of disk space and 4G of memory are recommended
- An internet connection
ⓘ Note: If you don’t meet these requirements, there are additional ways of installing MicroK8s, including additional OS support and an offline deploy. See the alternative install page for details.
MicroK8s will install a minimal, lightweight Kubernetes you can run and use on practically any machine. It can be installed with a snap:
sudo snap install microk8s --classic --channel=1.21
Join the group
MicroK8s creates a group to enable seamless usage of commands which require admin privilege. To add your current user to the group and gain access to the .kube caching directory, run the following two commands:
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
MicroK8s has a built-in command to display its status. During installation you can use the
--wait-readyflag to wait for the Kubernetes services to initialise:
microk8s status --wait-ready
MicroK8s bundles its own version of
kubectlfor accessing Kubernetes. Use it to run commands to monitor and control your Kubernetes. For example, to view your node:
microk8s kubectl get nodes
…or to see the running services:
microk8s kubectl get services
MicroK8s uses a namespaced kubectl command to prevent conflicts with any existing installs of kubectl. If you don’t have an existing install, it is easier to add an alias (append to
~/.bash_aliases) like this:
alias kubectl='microk8s kubectl'
Deploy an app
Of course, Kubernetes is meant for deploying apps and services. You can use the
kubectlcommand to do that as with any Kuberenetes. Try installing a demo app:
microk8s kubectl create deployment nginx --image=nginx
It may take a minute or two to install, but you can check the status:
microk8s kubectl get pods
MicroK8s uses the minimum of components for a pure, lightweight Kubernetes. However, plenty of extra features are available with a few keystrokes using “add-ons” – pre-packaged components that will provide extra capabilities for your Kubernetes, from simple DNS management to machine learning with Kubeflow!
To start it is recommended to add DNS management to facilitate communication between services. For applications which need storage, the ‘storage’ add-on provides directory space on the host. These are easy to set up:
microk8s enable dns storage
Starting and Stopping MicroK8s
MicroK8s will continue running until you decide to stop it. You can stop and start MicroK8s with these simple commands:
… will stop MicroK8s and its services. You can start again any time by running:
Note that if you leave MicroK8s running, it will automatically restart after a reboot. If you don’t want this to happen, simply remember to run
microk8s stopbefore you power down.
- One node not enough? Try setting up a MicroK8s cluster.
- Want to experiment with alpha releases of Kubernetes? See the documentation on setting channels.
- Need to fiddle with the Kubernetes configuration? Find out how to configure the Kubernetes services.
- Find out how to run MicroK8s on Windows, macOS or a Raspberry Pi.
- Having problems? Check out our troubleshooting section.
- Love MicroK8s? Want to contribute or suggest a feature? Give us your feedback.
- Getting started
- Alternative install methods
- Behind a proxy
- Channels and versions
- High Availability
- Configuring services
- Multi-node cluster
- Authentication and authorization
- Adding an LMA stack
- Multi-user setup
- Changing the pod CIDR
- Adding Windows workers
- Release notes
- Command reference
- Services and ports used
- Working with kubectl
- Get in touch
- Contributing to docs
|Alternative installs (MacOS/Windows 10/Multipass)||/docs/install-alternatives|
|MicroK8s in LXD||/docs/lxd|
|Installing behind a proxy||/docs/install-proxy|
|Selecting a snap channel||/docs/setting-snap-channel|
|MicroK8s Add ons||/docs/addons|
|Configuring MicroK8s services||/docs/configuring-services|
|Clustering with MicroK8s||/docs/clustering|
|Services and ports||/docs/ports|
|Working with a public registry||/docs/registry-public|
|Using the built-in registry||/docs/registry-built-in|
|Working with a private registry||/docs/registry-private|
|Add on: Ambassador||/docs/addon-ambassador|
|Add on: fluentd||/docs/addon-fluentd|
|Add on: MetalLB||/docs/addon-metallb|
|Add on: host-access||/docs/addon-host-access|
|Add on: Ingress||/docs/addon-ingress|
|Add on: Multus||/docs/addon-multus|
|Add on: Portainer||/docs/addon-portainer|
|Add on: Traefik Ingress||/docs/addons-traefik|
|High Availability (HA)||/docs/high-availability|
|Get in touch||/docs/get-in-touch|
|Creating and editing MicroK8s documentation||/docs/docs|
|Working with kubectl||/docs/working-with-kubectl|
|MicroK8s with an external LMA||/docs/external-lma|
|Recovery of HA MicroK8s Clusters||/docs/ha-recovery|
|Changing the pods CIDR in a MicroK8s cluster||/docs/change-cidr|
|Add a Windows worker node to MicroK8s||/docs/add-a-windows-worker-node-to-microk8s|