Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

Sunday, October 17, 2021

Introduction to Docker

 Before we learn about Docker, let's try to understand some basics.

What is a container?

A container is an isolated environment, having their own processes and services (just like a VM), but they share the same OS kernel.

Docker is used to containerise applications and run them anywhere. 

Ah! So Docker is same as a VM (Virtual Machine)?

No! Refer image before for Docker vs VM



A Virtual Machine (VM) has its own OS. Hence, it would be more heavy and size would be in GBs.

Docker containers would be less heavy (MBs in size). Hence, docker containers boot up much faster.

Since VMs don't rely on the underlying OS, they are more isolated than docker containers.

Docker and VMs:

In large environments, we will often see docker containers provisioned on VM hosts.



Previously we may have a VM per application. In above case, we now have a VM containing many docker containers and hence # of VMs will reduce.

Where can we see list of images available?






Monday, October 14, 2019

Kubernetes: Features

When we plan to deploy containers on our own, we could run into some of the below mentioned issues:


  • Container communication
  • Deployment
  • Managing a container 
  • Auto scaling
  • Load balancing



Kubernetes helps in resolving the above mentioned issues.


Kubernetes automates container deployment, auto scaling and load balancing.


Some of the features that Kubernetes provides:


  • Communication between containers (each container is assigned an IP and a single DNS name for a set of containers)
  • Automatic packing of applications into containers
  • Scaling (add new or remove containers)
  • Restarts failed containers and can create new containers and nodes as a replacement if there is a crash.
  • Load balancing
  • Allows mounting of storage system
  • Rollout/Rollback (done automatically)


Docker Vs VM

In an earlier article we discussed Kubernetes and introduced Docker.

What is Docker?
As per wiki:

Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.


In simpler terms:

  • An application can have various components like Webserver, database etc where we could encounter an issue related to libraries or dependencies.
  • We can create a container per component and use docker to deploy them over a particular OS.
  • These can then communicate with each other.
  • Docker containers share the same OS kernel.
What is the difference between VMs and Dockers?

  1. Each VM comes with its own OS. Containers have applications (software) deployed for a particular OS kernel.
  2. VMs will be heavy and consume high disk space and compared to a container.
  3. VMs takes time to boot.
  4. VMs have their own OS and hence we can have VMs containing Windows and Linus deployed together. Docker containers share the OS kernel and hence having different OS software is not possible. This is however not a disadvantage since we can have two different deployments communicating with each other.

High Level Introduction to Kubernetes

This article will provide a high level introduction to Kubernetes (for beginners).

What is Kubernetes?

As per wiki definition:


Kubernetes (commonly stylized as k8s) is an open-source container-orchestration system for automating application deployment, scaling, and management. It was originally designed by Google, and is now maintained by the Cloud Native Computing Foundation. It aims to provide a "platform for automating deployment, scaling, and operations of application containers across clusters of hosts". It works with a range of container tools, including Docker.


In simpler terms:
  • It is an open source system for ADSM (Automating deployment, scaling and management).
  • It groups containers that make up an application into logical units for easy management and discovery.
  • Makes it easy to deploy and run applications (in a container)
At a high level, lets try to understand the concepts of Containers and Orchestration.

What are containers?

Traditionally, applications were deployed on physical servers. Running multiple applications caused resource allocation issues.
An application could compete with another for CPU or memory etc in the same physical server.

The solution for the above was to use different standalone physical servers per application.
This was not practical since that would involve many physical servers and some being underutilized.

As an improvement, the next deployment phase was to use VMs (virtual machines).
VMs were deployed on a single server. They had their own memory/CPU assigned and each VM was isolated from the other (from security standpoint).

Containers are similar to VMs. They are light weight since they have relaxed isolation properties to share the OS among applications. 
Like VMs, containers have their own filesystem, CPU and memory etc.
You could read up more on containers and their efficiency.

What is Kubernetes?
In very basic terms:

  • You have a container deployed in production.
  • Containers run applications and you need to ensure that there isn't any downtime.
  • If one containers fails, another should be up and running to distribute the load.
  • This framework - to run distributed load is provided by Kubernetes,
  • Where does Kubernetes help:
    • Load balance and distribute network traffic between containers
    • A new deployment can be as simple as create new containers and remove existing containers. New containers can be thoroughly tested before deployment.
    • Define CPU/Memory per container
    • Restarting stuck containers etc can be automated.
Docker is a very popular tool to deploy applications in a container.

As per wiki:

Docker is a set of platform-as-a-service products that use OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels.