What is a Container? (and Kubernetes)

144 views

I don’t have a computer science background and I often hear people talk about containers and Kubernetes. I frankly have no idea what it is and how it is different from a virtual machine (remote computer). Would like to understand what this is and why it is useful.

In: 1

4 Answers

Anonymous 0 Comments

The main difference between a VM and a container is how deep they go with their virtualization. A VM virtualizes everything down to the hardware layer. Everything that runs in a VM is the VM’s own stuff. It brings, loads and executes its own kernel, its own drivers, its own everything. A container on the other hand shares a lot of its lower level processes like the kernel with the operating system that it runs on. It doesn’t deal with hardware itself, it lets its host operating system do that for it. Which makes it much, much lighter than a full on VM.

What containers allow you to do is package entire environments in a convenient, well, package, which is isolated from the rest of the system (except for places you don’t want it to be, of course). Say you wanna host a database server. No need to set up an entirely new VM, install the required software packages, and configure them. You can just fire up a container that comes with all or most of the necessary binaries already installed into it and configured for an easy and fast start. Makes things very convenient. I mean you can also pre-package your own VMs for it, but as mentioned above, VMs are much heavier than containers. You don’t want to be virtualizing an entire system and loading an entire kernel and whatnot just to host a new instance of MySQL, which you don’t have to with a container. That lets you use your hardware resources much more efficiently.

Kubernetes is a system that organizes and coordinates multiple containers to operate a single service. Say you’re running a web application for a company. You have many servers distributed around the globe to optimize your website’s speed and performance for your users. You package the required software for your backend into neat containers, ready to be fired up in a moment’s notice wherever they’re needed. That’s where Kubernetes comes in. You set it up to determine where and when new servers are needed, and to create new instances as necessary. When demand blows up, it automatically starts new servers and integrates them into your network. When demand goes down, it trims down the number of servers to a more reasonable level. It’s like a manager type guy at a grocery store who determines when to open a new register and when to close them, based on how long the lines are.

You are viewing 1 out of 4 answers, click here to view all answers.