Virtualization Vs Containerization Vs Orchestration
Virtualization Vs Containerization Vs Orchestration
Container Orchestration
Sundararajan T
• Virtualization is a technology that lets
you create useful IT services using
resources that are traditionally bound to
hardware.
Virtualization
• It allows user to use a physical machine’s
full capacity by distributing its
capabilities among many users or
environments.
Virtualization Architecture
HOST OS
HARDWARE
Types of Virtualization
Guest OS Guest OS
Hypervisor Host OS
Hardware Hardware
Benefits of Hypervisors
• Lower cost
• Less Infrastructure
• Platform independent
• Speed
• Efficiency
• Minimal downtime
• Isolation
Containerization
• Containerization is a form of virtualization where
applications run in isolated user spaces, called
containers, while using the same shared operating
system (OS).
• Everything an application needs to run (its binaries,
libraries, configuration files, and dependencies) are
encapsulated and isolated in its container.
• Each container is an executable package of software,
running on top of a host OS.
• Commonly used container is Docker
Virtual Machines VS Containers
HOST OS HOST OS
HARDWARE HARDWARE
Docker
• Docker is an open platform for developing, shipping, and
running applications.
• Docker enables you to separate your applications from
your infrastructure so you can deliver software quickly.
• No more - “It works on my machine”
• Technology Independent
• Improved developer productivity
• Lightweight
IMAGE CONTAINER
Docker image is the image which contains the A Docker container is a virtualized run-time
source code, libraries, dependencies, tools and environment where users can isolate applications
other files needed for an application to run from the underlying system.
Due to their “read only” nature, these images are These containers are compact, portable units in
also called as a snapshot which you can start up an application quickly and
easily.
These are like templates which you cannot start or These containers run using the docker images
run the them. which is pulled locally or from the hub / registry
docker pulls images from Docker Hub. It is also We can run multiple container instance of the same
possible to manually specify the path of a registry image without any issues.
to pull from. For example, if you have set up a local
registry, you can specify its path to pull from it.
Docker Architecture
CLIENT DOCKER HOST REGISTRY
docker run
Installing Docker
• To pull the images to the local machine you can use the below command
• Syntax
• docker image pull <image_name>
Running a container
exec command
Container • Syntax
$ docker container stop <container_name>
$ docker container rm <container_name>
BUILD SHIP RUN
FROM –
Specify base COPY – Copying the index file
image to nginx html directory within
image
Building a Create Create Dockerfile with python base image and copy the files
• Docker network
• Docker logs
• Docker volume
• Docker swarm
• Docker compose
• Docker hub
• Docker registry
Container
Orchestration
• Container orchestration automates the
provisioning, deployment, networking,
scaling, availability, and lifecycle
management of containers
• Docker swarm, Kubernetes
• open-source container orchestration tool
• Developed by Google
• Helps to manage containerized application
• Supports containerd, CRI-O, docker and any other
implementation of the Kubernetes CRI (Container
Runtime Interface).
• Docker Desktop for Windows have
Kubernetes Kubernetes
Installation • Native Package installation in Linux
• Brew package manager in MAC
• Play with K8s
• https://labs.play-with-k8s.com/
Why Kubernetes?
Scheduler kubelet
Worker Node 1
kubeproxy
kubectl
pod
API API Server
Container
GUI Worker Node 2
Control Cluster
etcd Manager
Node
INGRESS
Ingress
provides routing rules to manage external access to services
my-app
SERVICE Configmap
External configuration of your application
Mongo-db Not recommended for confidential data
Secrets
Used to store secret data
DB Data would be encoded base64 by default
SERVICE
Volume
Storage on local or remote, outside of K8s cluster
VOLUME
Data will not be destroyed while pod scaled down
Replication
Statefulset
Databases can’t be replicated with deployment
due to its State and avoid data inconsistency
Statefulset used for DBs
Example Deployment with Kubernetes
1 2 3 4
Creating required Building an Image Creating the Deploying the
files to build image with tag Kubernetes application with
Deployment the manifest file
manifest file
(YAML)
app.py index.html
Requirements.txt
Dockerfile
Build the image
• kind – specify what kind of Kubernetes object going to be created
• metadata – contains name of the deployment
• labels – key, value pair attached to the resource
• service object can be created in different file or in same file separated by ---
• NodePort – to access the application externally
• Port – service port
• targetPort – Container port
• nodePort – Port used to access externally
• Virtualization
• Hypervisor, types of hypervisor and its architecture
• Benefits of Hypervisor
• Containerization
• Difference between containerization and virtualization
• Docker, Docker Image and Docker container
• Docker architecture