Sunday, September 8, 2019

Basics to Understand Modern Infrastructure


When discussing modern infrastructure or cloud infrastructure lots of terms are tossed around like virtualization, container, docker, etc. While it is not essential for everyone to understand these in detail, a basic/fundamental understanding/view is becoming essential for those who are  in the field of software development.

In fact, even a lot of people who may already use one or more of these, may still have some "vagueness" when it comes to explaining them to others. So, I wanted to capture some quick points which helped me have a high level  understanding of these. These may not be 100% technically correct, but should help the aforementioned purpose.

Virtualization / Virtual Machine (VM)

This once is fairly straight forward and most of us have a clear view on this. We have a physical machine with certain resources. Slicing this into multiple machines virtually is called virtualization. The OS running on these machines will see them as a physical machine. By the way, the physical machine is referred as the metal or bare metal servers. Sometimes they are also referred as host machines. The slices are called virtual machines or VMs.

Vagrant

When slicing the physical machine into multiple into virtual ones, we need to provide the definition, including its software configuration, for each of these machines. As multiple virtualization tools came up, there was a need to create this definition that was not tied to a specific tool. Vagrant is a tool that fills that need. Create the definition as a vagrant definition and use that definition to run the VM and the software setup on any virtualization tool.
Container and Docker

A container is actually a combination features of Linux kernel which provide an isolation to a group of processes. For this reason they are also called as OS level virtualization. While the features required for this like cgroups and namespace isolation are available at the OS level, container tools offer them as a bundle, hiding the details. See LXC

Docker is a tool that helps to define such containers with a specific run time like OS etc. and then run them by leveraging the container features of Linux. See here for more details and technically correct information.

Kubernetes
Kubernetes (you would see this also referred as k8s) is a container orchestration platform. Instead of dealing with individual containers, Kubernetes deals with what's called a Pod, that represent the group of resources for an application. It then manages them by scaling the number of instances, choosing the node to run them, monitor, restart etc. See here for more information.