Containerization, Docker vs Kubernetes! and Microsoft Azure’s Kubernete-Edge experiment


This article explains about containerization of applications on edge devices, clears the air about Kubernete versus Docker debate and talks about an experimental feature which helps you leverage Kubernetes for your IoT Edge Deployments.

This article was originally published on LinkedIn

Containerization is a lightweight OS-level virtualization solution to package, deploy and run distributed applications. It is an alternative to using an entire VM for each application. Containers can be seen as multiple isolated applications or services that run on a single host and access the same operating system, whereas, Each VM would run its operating system on top of a shared hypervisor.

Containers usually run on bare-metal systems but can be deployed on cloud instances and virtual machines. These containers can be deployed across Linux OSs and also run on select Windows & Mac OSs.

How does containerization works?

containers

A Container is an application bundled with its runtime environment required for its execution. This includes components such as files, libraries, and environment variables. Each container is deployed as an image. Containers share the same kernel and consume the same OS resources. So they themselves do not consume much of a space. But it makes them vulnerable to Denial of Service (if one application starts consuming most of the OS resources).

This packaging of applications with self-contained environments has its advantages like quicker deployments and scalability and hence makes a good case for its use on IoT Edge devices. Microsoft Azure’s IoT Edge uses containerization as a standard approach for deployments of its IoT Edge modules.

Docker vs Kubernetes! Really?

Docker and Kubernetes are not the same things which makes a case for a wrong comparison. Docker is a container platform which includes “Docker Engine” and a “Docker Hub”. Docker engine is a runtime used to build and run containers while Docker hub is a repository to store and share container images for deployments.

I understand Docker but What is Kubernetes?

Docker provided for a method to package and distribute containers but it was lacking in some of the important things like scheduled deployments and scaling of containerized systems. All of these orchestrations were the pain points that remained. Google came up with “Kubernetes” and Docker came up with “Docker Swarm” to help solve these problems. So the right comparison is not “Docker vs Kubernetes” but in fact “Docker Swarm vs Kubernetes”.

Kubernetes is the container orchestrator. It is a comprehensive system for scheduling, automating and scaling of containerized applications and one of the containerization tools it supports is Docker. It makes a cluster of machines behave like one big machine.

Microsoft Azure’s Kubernete-Edge experiment!

Microsoft has come up with a system for container deployment on Edge devices using Kubernetes. It is an experimental feature as of now –

Kubernetes nodes are typically a VM and these nodes make a Kubernete cluster. Containers pushed to containers are deployed inside these VMs. I can think of Azure Edge devices as those VMs and group of these devices can be part of Microsoft Azure’s Kubernete cluster. The architecture to the right is courtesy of Microsoft which explains how edge deployments can be done using Kubernetes.

Virtual Kublet can interpret Kubernetes commands which can be used to handle containers other than just placing them in VMs. IoT Edge Virtual Kublet is placing containers on Edge devices. These devices look like they are part (node) of the Kubernete cluster. When you push containers to IoT Edge provider, it can be considered as IoT Edge deployment. It will go through IoT Hub and gets deployed to the actual Edge device. For Kubernetes Master it seems like one big Kubernete cluster but in reality, containers are running on Edge devices.

Note – The IoT Edge provider is still in development and some of its features does not work properly. You can find its Git repo here.

More