0% found this document useful (0 votes)
192 views26 pages

Docker Kubernete For Training

Docker allows developers to package applications with dependencies into standardized containers that can be deployed efficiently across systems. It provides lightweight virtualization compared to traditional virtual machines. Kubernetes is an open-source tool for automating deployment, scaling, and management of containerized applications. It uses a master-slave architecture with masters coordinating nodes that host application pods.

Uploaded by

Swathi G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views26 pages

Docker Kubernete For Training

Docker allows developers to package applications with dependencies into standardized containers that can be deployed efficiently across systems. It provides lightweight virtualization compared to traditional virtual machines. Kubernetes is an open-source tool for automating deployment, scaling, and management of containerized applications. It uses a master-slave architecture with masters coordinating nodes that host application pods.

Uploaded by

Swathi G
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 26

DOCKER

DOCKER : DEFINE

Docker is a tool that allows developers, sys-admins etc. to easily deploy their
applications in a sandbox (called containers) to run on the host operating system i.e.
Linux.
The key benefit of Docker is that it allows users to package an application with all
of its dependencies into a standardized unit for software development.
Unlike virtual machines, containers do not have high overhead and hence enable
more efficient usage of the underlying system and resources.
Docker is a tool designed to make it easier to create, deploy, and run
applications by using containers.
CONTAINERS : DEFINE
Containers allow a developer to package up an application with all of the parts it needs,
such as libraries and other dependencies, and ship it all out as one package. 
Create self-contained development environments inside Docker containers.
So we share an environment already configured.
IMAGE : DOCKER
An image is a lightweight, stand-alone, executable package that includes
everything needed to run a piece of software, including the code, a runtime,
libraries, environment variables, and config files.
So an existing fellow developer will create an image of his environment and share it
with the new developer.
The new developer will just have to run the image as a docker container.
IMAGE & CONTAINER : DOCKER
CASE STUDY: DOCKER
A container is a runtime instance of an image what the image becomes in memory when
actually executed.
It runs completely isolated from the host environment by default, only accessing host files
and ports if configured to do so. 
DOCKER : CASE STUDY
DEPLOYING MULTIPLE SPRING BOOT
MICROSERVICES TO DOCKER USING
DOCKER NETWORKING
DEPLOYING MULTIPLE SPRING BOOT
MICROSERVICES TO DOCKER USING
DOCKER NETWORKING
A Docker Container should have only a
single service running.
Deploying two microservices employee-
producer and employee-consumer to two
different containers and then have them
interact with each other.
DOCKER COMPOSE
Docker Compose is a tool for defining and running multi-container Docker applications.
With Compose, you use a YAML file to configure your application's services.
Then, with a single command, you create and start all the services from your
configuration.

Now again lets check the docker-compose version


$ docker-compose --version
DOCKER COMPOSE
Create docker compose file

[root@centos7 restsql]# cat docker-compose.yml


version: "3"
services:
rest-jdbc: mysqldb:
image: rest-jdbc image: docker.io/mysql:8
networks:
ports: - country-mysql
- "8080:8080" environment:
networks: - MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=countrydb
- country-mysql volumes:
depends_on: - ./dbscript:/docker-entrypoint-initdb.d
- mysqldb
networks:
country-mysql:
WHAT IS ORCHESTRATION?
Orchestration is the automated configuration, management, and coordination of
computer systems, applications, and services.

A number of tools exist for automation of server configuration and management,


including Ansible, Puppet, Salt, Terraform, and AWS CloudFormation.

Orchestration helps IT to more easily manage complex tasks and workflows.


WHAT IS KUBERNETES?
Kubernetes is an open-source container management (orchestration) tool.
It’s container management responsibilities include container deployment, scaling &
descaling of containers & container load balancing.
FEATURES OF KUBERNETES
KUBERNETES ARCHITECTURE
KUBERNETES ARCHITECTURE
Kubernetes implements a cluster computing background, everything works from inside
a Kubernetes Cluster.
 This cluster is hosted by one node acting as the ‘master’ of the cluster, and other nodes as ‘nodes’ which do
the actual ‘containerization‘. 

Master controls the cluster, and the nodes in it.


 It ensures the execution only happens in nodes and coordinates the act. 

Nodes host the containers; in-fact these Containers are grouped logically to form Pods.
 Each node can run multiple such Pods, which are a group of containers, that interact with each other, for a
deployment. 

Replication Controller is Master’s resource to ensure that the requested no. of pods are
always running on nodes. 
Service is an object on Master that provides load balancing across a replicated group of
Pods.
KUBERNETES ARCHITECTURE

Kubernetes Architecture
has the following main components:
 Master nodes
 Worker/Slave nodes
 Distributed key-value store
KUBERNETES CASE-STUDY
Solution:
container workflow
OpenStack instances are used, with Docker, Kubernetes, Calico, etcd on top of it to perform
various operations like Container Networking, Container Registry, and so on.
SETTING UP KUBERNETES
(K8S) ON WINDOWS
Install Cygwin
Install MiniKube
Install Kubectl
Install Oracle Virtual box
VIEWING PODS AND NODES
Kubernetes Pods
Pods are the atomic unit on the Kubernetes platform.
When we create a Deployment on Kubernetes, that Deployment creates Pods with containers inside
them (as opposed to creating containers directly).
Each Pod is tied to the Node where it is scheduled, and remains there until termination (according
to restart policy) or deletion.
In case of a Node failure, identical Pods are scheduled on other available Nodes in the cluster.
VIEWING PODS AND NODES
Nodes
A Pod always runs on a Node.
A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine,
depending on the cluster.
Each Node is managed by the Master. A Node can have multiple pods, and the Kubernetes master
automatically handles scheduling the pods across the Nodes in the cluster.
The Master's automatic scheduling takes into account the available resources on each Node.
VIEWING PODS AND NODES
Nodes
Every Kubernetes Node runs at least:
Kubelet, a process responsible for communication
between the Kubernetes Master and the Node; it
manages the Pods and the containers running on a
machine.
A container runtime (like Docker, rkt) responsible
for pulling the container image from a registry,
unpacking the container, and running the
application.
TUTORIAL TO RUN A
SAMPLE APP ON
KUBERNETES
If you installed Minikube locally, run :
USING
MINIKUBE
minikube start
check :
minikube status

Open the Kubernetes dashboard in a browser:

minikube dashboard
TUTORIAL TO RUN A
SAMPLE APP ON
KUBERNETES USING
Create a Deployment
MINIKUBE
--------------------------------
A Kubernetes Pod is a group of one or more Containers, tied together for the purposes of administration and
networking.
The Pod here has only one Container.
A Kubernetes Deployment checks on the health of your Pod and restarts the Pod's Container if it terminates.

Use the kubectl create command to create a Deployment that manages a Pod.
The Pod runs a Container based on the provided Docker image.

Command: kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4


TUTORIAL TO RUN A
SAMPLE APP ON
KUBERNETES USING
View the Deployment: kubectl get deployments
MINIKUBE
The output is similar to:
NAME READY UP-TO-DATE AVAILABLE AGE
hello-node 1/1 1 1 1m

View the Pod: kubectl get pods


The output is similar to:
NAME READY STATUS RESTARTS AGE
hello-node-5f76cf6ccf-br9b5 1/1 Running 0 1m

detail View the Pod: kubectl get pods -o wide


View cluster events: kubectl get events
View the kubectl configuration: kubectl config view

You might also like