UNIT 5 - NodeJS and Microservices

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

RAJA S

IBM – CORPORATE TRAINER


UNIT 5 - CONTAINER, DOCKER &
KUBERNETES
Docker Container:
• A Docker container is a lightweight and executable package of
software.
• It includes everything used to run an application, code, libraries,
and dependencies.
• You don’t need to allocate any memory for the application.
• It can automatically generate space according to the requirements.
Why to learn Docker?
Why to learn Docker?

• A couple of years back, when organizations needed other applications, they buy a server without
knowing the performance requirement of the software/application. This results waste of money and
resources. Then Virtual machines come onto the market, which allows engineers to run multiple
applications on the same resource but as a completely different server. But Every application to run
on a Virtual machine requires OS and every OS needs its own CPU, RAM, etc. to run. Which
increases the cost.

• Then Docker Model comes into the scope, which overcomes the drawbacks of the Virtual Machine. It
reduces the wastage of resources by sharing OS, memory, and CPU, and It offers many benefits for
developers and system administrators, like consistency, portability, efficiency, security, scalability,
and version control. These benefits make it easier to manage and deploy applications.
Features of Docker
•Docker reduces the size of development by providing a smaller
part of the OS via containers.
•It is easier to work on the same project by different teams with
the help of Containers.
•Docker containers can be deployed anywhere, on any physical,
or virtual machines and on the cloud.
•Docker containers are lightweight so, it becomes easy to scale
them.
Advantages of Docker

•Docker uses less memory.


•The full operating system is not required to run an application.
•Containers run faster than the other Virtual Machines.
•It is lightweight.
•It allows us to use a remote repository to share your containers with
other teams.
•To reduce the risks, it uses dependencies.
Disadvantages of Docker
•Complexity will increase due to layering.
•It is difficult to manage a large number of containers.
•For an application that needs better graphics, Docker is not
suitable for it.
•Cross-platform compatibility is not allowed.
Virtual machines
• A virtual machine (VM) is a computer file that behaves like a
real computer, running in a window as a separate computing
environment. VMs can run different operating systems, or
even function as the user's entire computer experience. VMs
are often used on work computers.
• It runs on top of an emulating software called the hypervisor
which sits between the hardware and the virtual machine.
• The hypervisor is the key to enabling virtualization. It
manages the sharing of physical resources into virtual
machines.
• Each virtual machine runs its guest operating system. They
are less agile and have lower portability than containers.
Difference between Virtual machines and
Containers.
SNo. Virtual Machines(VM) Containers
1 VM is a piece of software that allows you to While a container is software
install other software inside of it so you control that allows different
it virtually as opposed to installing the software functionalities of an application
directly on the computer. independently.

2. Applications running on a VM system, or While applications running in a


hypervisor, can run different OS. container environment share a
single OS.

3. VM virtualizes the computer system, meaning While containers virtualize the


its hardware. operating system, or the
software only.
SNo. Virtual Machines(VM) Containers
4. VM size is very large, generally in gigabytes. While the size of the container is very
light, generally a few hundred megabytes,
though it may vary as per use.

5. VM takes longer to run than containers, the exact time depending While containers take far less time to run.
on the underlying hardware.

6. VM uses a lot of system memory. While containers require very less


memory.

7. VM is more secure, as the underlying hardware isn’t shared While containers are less secure, as the
between processes. virtualization is software-based, and
memory is shared.

8. VMs are useful when we require all of the OS resources to run While containers are useful when we are
various applications. required to maximize the running
applications using minimal servers.

9. Examples of Type 1 hypervisors are KVM, Xen, and VMware. Examples of containers are RancherOS,
Virtualbox is a Type 2 hypervisor PhotonOS, and Containers by Docker.
Dev vs Ops
1.Development (Dev):
1.Development teams are responsible for writing code, creating new features, and implementing
changes requested by stakeholders.
2.They focus on building and testing software applications to meet business requirements.
3.Developers often work with programming languages, frameworks, version control systems, and
development tools.
2.Operations (Ops):
1.Operations teams are responsible for deploying and maintaining software applications in
production environments.
2.They manage servers, networks, databases, and infrastructure to ensure the reliability,
availability, and performance of applications.
3.Operations professionals typically deal with monitoring, scaling, security, and troubleshooting
issues in production environments.
Architecture of Docker
Kubernetes
Kubernetes
• Kubernetes is a tool that helps us to run and manage applications in containers.
• It was developed by Google Lab in 2014, and it is also known as k8s.
• It is an open-source container orchestration platform that automates the deployment,
management, and scaling of container-based applications in different kinds of
environments like physical, virtual, and cloud-native computing foundations.
• Containers are isolated from each other so that multiple containers can run on the same
machine without interrupting anyone else.
• It allows us to deploy and manage container-based applications across a Kubernetes
cluster of machines.
Introduction to Kubernetes (K8S)

Kubernetes is an open-source platform that manages Docker containers


in the form of a cluster. Along with the automated deployment and
scaling of containers, it provides healing by automatically restarting
failed containers and rescheduling them when their hosts die. This
capability improves the application’s availability.
What is Kubernetes (k8s)?

• Kubernetes is an open-source Container Management tool that automates


container deployment, container scaling, descaling, and container load
balancing (also called a container orchestration tool).
• It is written in Golang and has a vast community because it was first developed
by Google and later donated to CNCF (Cloud Native Computing Foundation).
• Kubernetes can group ‘n’ number of containers into one logical unit for
managing and deploying them easily. It works brilliantly with all cloud vendors
i.e. public, hybrid, and on-premises.
Benefits of Using Kubernetes

1. Automated deployment and management


2. Scalability
3. High availability
4. Cost-effectiveness
5. Improved developer productivity
Architecture of Kubernetes
• Kubernetes follows the client-server architecture where we have the
master installed on one machine and the node on separate Linux
machines. It follows the master-slave model, which uses a master to
manage Docker containers across multiple Kubernetes nodes.
• A master and its controlled nodes(worker nodes) constitute
a “Kubernetes cluster”.
• A developer can deploy an application in the docker containers with the
assistance of the Kubernetes master.
Architecture of Kubernetes
Application of Kubernetes
1. Microservices architecture:
2. Cloud-native development:
3. Continuous integration and delivery:
4. Hybrid and multi-cloud deployments:
5. High-performance computing:
6. Edge computing:
Application of Kubernetes​
1.Microservices architecture: Kubernetes is well-suited for managing
microservices architectures, which involve breaking down complex
applications into smaller, modular components that can be independently
deployed and managed.​

2.Cloud-native development: Kubernetes is a key component of cloud-


native development, which involves building applications that are designed
to run on cloud infrastructure and take advantage of the scalability,
flexibility, and resilience of the cloud.​

3.Continuous integration and delivery: Kubernetes integrates well with


CI/CD pipelines, making it easier to automate the deployment process and
roll out new versions of your application with minimal downtime.
4.Hybrid and multi-cloud deployments: Kubernetes provides a
consistent deployment and management experience across different cloud
providers, on-premise data centers, and even developer laptops, making it
easier to build and manage hybrid and multi-cloud deployments.

5.High-performance computing: Kubernetes can be used to manage


high-performance computing workloads, such as scientific simulations,
machine learning, and big data processing.

6.Edge computing: Kubernetes is also being used in edge computing


applications, where it can be used to manage containerized applications
running on edge devices such as IoT devices or network appliances.
KUBERNETES ARCHITECTURE AND
COMPONENTS:

You might also like