Personal Development Category (English)728x90

Get smallest, fastest, fully-conformant MicroK8s Kubernetes

Disclosure: This page uses affiliate links.When you click an affliate link,we get a small compensation at no cost to you.Thanks for your support!Learn more

Kubernetes as we know coordinates a highly available cluster of computers that are connected to work as a single unit. Kubernetes contains a number of abstractions that allow the deployment of containerized applications to the cluster without attaching them to individual machines.

In short, Kubernetes is –

  • Portable: public, private, hybrid, multi-cloud
  • Extensible: modular, pluggable, hook able, composable
  • Self-healing: auto-placement, auto-restart, auto-replication, auto-scaling

In this post, we are going to take look at Lightweight Kubernetes engine MicroK8s that can run on edge, IoT, and appliances.MicroK8s is great for offline development, prototyping, and testing purpose.You can also use it on a VM as a small, cheap, reliable k8s for CI/CD.

Cross-posted from: NewStack

In the next section, we will look at how to install and deploy sample application on to MicroK8s cluster.

Subscribe to Emails

More than 100,000 subscribers across the world trust & read Upnxtblog articles. Subscribe to emails updates!
* indicates required

Step#1. Install MicroK8s

In the below steps, we would be installing MicroK8s cluster, it would install a limited set of components like api-server, controller-manager, scheduler, kubelet, cni, kube-proxy. Additional services like kube-dns and dashboard can also be run using the microk8s.enable command.


  • You should have either Ubuntu 18.04 LTS or 16.04 LTS environment
  • 20G of disk space and 4G of memory is recommended

MicroK8s is deployed via Snaps. Snaps are containerized (like docker) software packages that are easy to create and install, they bundle their dependencies, they work on all major Linux systems without modification. Snaps auto-update and are safe to run. Also, note MicroK8s snap would be frequently updated to match each release of Kubernetes.

MicroK8s snap can be installed using the command below:

Devops Engineer Masters Program will make you proficient in DevOps principles like CI/CD, Continuous Monitoring and Continuous Delivery, using tools like Puppet, Nagios, Chef, Docker, Git & Jenkins. It includes training on Linux, Python, Docker, AWS DevOps Certification Training and Splunk. The curriculum has been determined by extensive research on 5000+ job descriptions across the globe.
New customer offer! Top courses from $13.99 when you first visit Udemy

snap install microk8s --classic --beta

Install Microk8s

Image – Install Microk8s

Recover over 700 unique file formats. Fully recover documents, emails, photos, videos, audio files and more. Supports 8 different data lost scenarios: deleted files recovery, recycle bin recovery, formatted drive recovery, lost partition recovery, externa

To avoid colliding with a kubectl already installed and to avoid overwriting any existing Kubernetes configuration file, MicroK8s adds a microk8s.kubectl command. If you are only using MicroK8s, consider adding an alias using the following command:

Adding an alias to microk8s

Image – Adding an alias to Microk8s.kubectl

Step#2. Verify Installation

At this point you have installed MicroK8s, check whether the newly deployed node is in Ready state using the following command

kubectl get node

Verify Microk8s Install

Image – Verify Microk8s Installation

If you receive an error it means that microk8s is still starting the nodes in the background. Wait for a few minutes and try again.

You can also use kubectl describe the command to get the details of the node.

Verify Microk8s install

Image – Verify Microk8s Installation

Career Category (English)640x480

Step#3. Deploy sample application

At this point, you have a fully functional Kubernetes cluster. The following command will deploy Nginx web application.

kubectl run nginx --image nginx:alpine

Deploy application

Image – Deploy the application

Once Nginx has been deployed, the application can be exposed with the following command.

kubectl expose deployment nginx \
--port 80 \
--target-port 80 \
--type ClusterIP \
--selector=run=nginx \
--name nginx

Google IT Support Professional Certificate by Grow with Google (300x600) - 2
Expose application

Image – Expose application

You should see a new Service and ClusterIP address assigned.

New Service and ClusterIP address assigned

Image – New Service and ClusterIP address assigned.

Now that services are exposed outside, we can launch lynx a terminal-based web browser to access the Nginx application using the following command.

export CLUSTER_IP=$(kubectl get svc/nginx -o go-template='{{(index .spec.clusterIP)}}')
lynx $CLUSTER_IP:80

Nginx app

Image – Nginx app deployed on Microk8s cluster

Congrats! now you have a deployed Nginx application to a fully functional Kubernetes cluster using Microk8s.

Step#4. Deploy Addons (optional)

Additional services like kube-dns and dashboard can be enabled using the microk8s.enable command.

microk8s.enable dns dashboard

Install Addons

Image – Install Addons

Start your future with a Data Analysis Certificate.

Check to see if all the components for the additional services being started using the following command:

kubectl get all --all-namespaces

Check the status of additional services

Image – Check the status of additional services

MicroK8s gives you troubleshooting tools to check out what has gone wrong. Be sure to check out the common issues section for help in resolving the frequently encountered problems.

Useful Resources :

Like this post? Don’t forget to share it!

Online business courses to jumpstart your future.
Get smallest, fastest, fully-conformant MicroK8s Kubernetes
Article Name
Get smallest, fastest, fully-conformant MicroK8s Kubernetes
In this post,we are going to take look at Lightweight Kubernetes engine MicroK8s that can run on edge, IoT and appliances
Publisher Name
Publisher Logo

One thought on “Get smallest, fastest, fully-conformant MicroK8s Kubernetes”

  1. Pingback: TOP 7 Managed Kubernetes Platforms
  2. Trackback: TOP 7 Managed Kubernetes Platforms

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: