Introduction to MicroK8s – Part 1/2

anaqvi

on 16 September 2019

Every developer, systems admin and tech enthusiast is interested in learning Kubernetes. Kubernetes is a complex container orchestration tool that can be overwhelming for beginners. Kubernetes has been the buzzword in the tech industry and for good reason. If you’re itching to get started with Kubernetes and not looking forward to the complexities involved, this first blog of a series is for you. We’ll walk you through getting up and running in a jiffy with a Kubernetes deployment using MicroK8s. The following blogs will do a deeper dive into add-ons and usage.

What is MicroK8s?

MicroK8s is a powerful, lightweight, reliable production-ready Kubernetes distribution. It is an enterprise grade Kubernetes distribution that has a small disk and memory footprint while offering production grade add-ons out-the-box such as Istio, Knative, Grafana, Cilium and more. Whether you are running a production environment or interested in exploring K8s, MicroK8s serves your needs.

Why MicroK8s?

MicroK8s is the smallest, fastest multi-node Kubernetes. Single-package fully conformant lightweight Kubernetes that works on 42 flavours of Linux as well as Mac and Windows using Multipass. Perfect for: Developer workstations, IoT, Edge, CI/CD.

Anyone who’s tried to work with Kubernetes knows the pain of having to deal with getting setup and running with the deployment. There are minimalist solutions in the market that reduce time-to-deployment and complexity but the light weight solutions come at the expense of critical extensibility and missing add-ons.

If you don’t want to spend time jumping through hoops to get Kubernetes up and running, MicroK8s gets you started in under 60 seconds.

  • Small: Developers want the smallest K8s for laptop and workstation development. MicroK8s provides a standalone K8s compatible with Azure AKS, Amazon EKS, Google GKE when you run it on Ubuntu.
  • Simple: Minimize administration and operations with a single-package install that has no moving parts for simplicity and certainty. All dependencies and batteries included.
  • Secure: Updates are available for all security issues and can be applied immediately or scheduled to suit your maintenance cycle.
  • Current: MicroK8s tracks upstream and releases beta, RC and final bits the same day as upstream K8s. You can track latest K8s or stick to any release version from 1.10 onwards.
  • Comprehensive: MicroK8s includes a curated collection of manifests for common K8s capabilities and services:
    • Service Mesh: Istio, Linkerd
    • Serverless: Knative
    • Monitoring: Fluentd, Prometheus, Grafana, Metrics
    • Ingress, DNS, Dashboard, Clustering
    • Automatic updates to the latest Kubernetes version
    • GPGPU bindings for AI/ML
    • Cilum, Helm and Kubeflow!

Basic Definitions of Concepts

  • Snaps: Snaps are app packages for desktop, cloud and IoT that are easy to install, secure, cross-platform and dependency-free.
  • kubectl: A command line interface for running commands on Kubernetes cluster.
  • Container: Containers are used as the building blocks of creating applications.
  • Pod: A pod is a collection of one or more containers that share storage and network resources. Pods contain the definition of how the containers should be run in Kubernetes. For example, you can define you need two pods. During execution, if a pod goes down, a new pod will be automatically started.
  • Service: Since pods are replaceable, Kubernetes needs an abstraction layer to keep the interaction between the different pods seamless. For example, if a pod dies and a new pod is created, the application users shouldn’t be bothered by it. Services are wrappers around the pods to create levels of abstraction.
  • Master: Master coordinates the cluster. It’s like the brains of the operation.
  • Node: Workers who run the pods.

Prerequisites

To run MicroK8s, you will need a computer with a Linux distribution that supports Snaps such as Ubuntu 🙂 If you have a Windows PC or a Mac, you can use Multipass to get MicroK8s running.

 

Getting Started

Now that we have the context on what MicroK8s is, and said how easy it is to get started, let’s take it for a spin.

1. Installation

sudo snap install microk8s --classic

In under 60 seconds you should have your distribution up and running!

2. Start MicroK8s and check the status of MicroK8s using the following commands:
sudo microk8s.start

microk8s.status

You screen should look something like the figure above. You can see MicroK8s is running which means you have your Kubernetes going!

What’s Next?

Well, this one liner setup that’s made so simple by MicroK8s usually has a lot of hurdles and complexities involved if you’re setting it up manually. Now that you have your Kubernetes deployment up, that’s just the beginning. To do useful stuff you need to do even more complex tasks for setting up components depending on your work needs. This is where the add-ons come in; MicroK8s comes packed with powerful add-ons which again, will save you from the complexities of setting these up and get you going with a few lines of commands.

Head on to the next blog post to explore a use case and see the power and magic of simplified K8s using MicroK8s!

Ubuntu cloud

Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.

Newsletter signup

Select topics you’re
interested in

In submitting this form, I confirm that I have read and agree to Canonical’s Privacy Notice and Privacy Policy.

Related posts

Kubectl and friends as a snap

At Canonical, we build solutions to simplify the lives of our users. We want to reduce complexity, costs, and barriers to entry. When we built the Canonical...

Container registry for Kubernetes with GitLab

Container orchestration solutions such as Kubernetes allow development teams to be quick and agile with their software deployments. “One of the main features...

Deploying Kubernetes Locally – MicroK8s

This is the second part of our introduction to MicroK8s blog series. In the previous blog, we introduced MicroK8s, went over K8s basic concepts and showed you...