SlideShare a Scribd company logo
DEVOPS WITH
DOCKER AND
KUBERNETES
SOA presentation
1
2024-2025
Deploying a Django Application
Introduction to DevOps
01
Understanding Docker
02
Introduction to Kubernetes
03
Benefits of Docker and Kubernetes in
DevOps
Conclusion
04
05
06
Table of
Table of
contents
contents
2
INTRODUCTION
TO
3
Introduction to DevOps
Introduction to DevOps
4
Why DevOps is revolutionizing software development ?
Introduction to DevOps
Introduction to DevOps
5
Why DevOps is revolutionizing software development ?
Introduction to DevOps
Introduction to DevOps
6
Why DevOps is revolutionizing software development ?
Introduction to DevOps
Introduction to DevOps
7
Why DevOps is revolutionizing software development ?
8
Introduction to DevOps
Introduction to DevOps
Who Introduced DevOps and When?
Patrick Debois DevOpsDays conference
the "Father of DevOps” 2009
Introduction to DevOps
Introduction to DevOps
9
Why DevOps is revolutionizing software development ?
Devops is not a technology, tool or framework .
DevOps is a cultural movement, mindset, philosophy to coordiante produce better, more reliable products.
by automating infrastructure, workflow, and continuously measuring application performance
for which they use a lot of tools.
Introduction to DevOps
Introduction to DevOps
10
Why DevOps is revolutionizing software development ?
The DEVOPS lifecycle :
You can visualize a Devops process as an infinite
loop, comprising the illustrated steps through
feedback --plan , which resets the loop.
Understanding
11
Understanding Docker
Understanding Docker
12
What is Docker ?
1.
Docker is a powerful platform that
simplifies the process of building,
shipping, and running applications.
Understanding Docker
Understanding Docker
13
Solomon Hykes
1.1 - History of docker :
Understanding Docker
Understanding Docker
14
1.2 - VMs Containers :
15
Understanding Docker
Understanding Docker
1.3 - Docker Architecture :
Understanding Docker
Understanding Docker
16
1.4 - The Process of Creating Containers
Definition: Scripts used to create Docker images.
Purpose: Automates and ensures repeatable, consistent
image creation.
Structure: A text file containing a series of commands
that Docker uses to assemble an image
2. DockerFile :
Understanding Docker
Understanding Docker
17
3. Docker image :
These are the blueprints of applications.
A Docker image is a lightweight, standalone, and
executable package that includes everything needed to
run a piece of software .
Images are immutable, meaning once they’re created,
they don’t change.
Understanding Docker
Understanding Docker
18
Understanding Docker
Understanding Docker
Docker image Registries
19
4. Docker container :
A Docker container is like that lunchbox
self-sufficient and portable.
Imagine you have a lunchbox that contains
everything you need for a meal.
Understanding Docker
Understanding Docker
20
Toss it, and it leaves no mess. Stop the container, and it leaves no
mess.
Multiple containers on a host
Multiple lunchboxes in your
backpack.
You can have
When you're done
Understanding Docker
Understanding Docker
21
Docker containers are runnable instances of Docker images.
They encapsulate the application and its dependencies, providing
an isolated environment for execution.
Containers can be created, started, stopped, moved, and deleted
using Docker commands.
4. Docker container :
So, what’s a docker container ?
Understanding Docker
Understanding Docker
22
5. Docker compose :
Understanding Docker
Understanding Docker
23
Docker Compose is a tool for defining and running
multi-container Docker applications.
It uses a YAML file (docker-compose.yml) to
specify services, networks, volumes, and other
configurations required for the application.
5. Docker compose :
Understanding Docker
Understanding Docker
24
25
6. Docker Volumes:
Understanding Docker
Understanding Docker
26
7. Docker Networking:
Understanding Docker
Understanding Docker
Docker Hub is a cloud-based repository service
provided by Docker for storing and sharing Docker
images.
It serves as a central hub for the Docker community,
offering access to thousands of public images and
enabling collaboration among developers and
operations teams.
Understanding Docker
Understanding Docker
8. DOCKER HUB :
27
Before Docker Hub
Lack of
Standardization
No Centralized
Storage
Collaboration
Barriers
Limited
Automation
Quality Control
Issues
8. DOCKER HUB :
Understanding Docker
Understanding Docker
28
Searching for Images:
Use the docker search command to search for images on Docker Hub:
Pulling Images:
Pull Docker images from Docker Hub using the docker pull command:
Pushing Images:
Push local Docker images to Docker Hub using the docker push command :
Understanding Docker
Understanding Docker
8. DOCKER HUB :
29
Introduction to
30
Introduction to Kubernetes
Introduction to Kubernetes
31
What is Kubernetes ?
1.
Kubernetes, or K8s, is an open-
source platform designed to
automate the deployment,
management, and scaling of
containerized applications.
32
Created by Google, now maintained by the Cloud Native Computing
Foundation (CNCF).
Kubernetes is tailored for modern, container-based environments, such as
those orchestrated with Docker
2014
2015
Introduction to Kubernetes
Introduction to Kubernetes
Key Purposes of Kubernetes
34
2.Kubernetes Architecture
Introduction to Kubernetes
Introduction to Kubernetes
Introduction to Kubernetes
Introduction to Kubernetes
35
What is a Cluster ?
A group of computers (physical or
virtual) that work together as a
system.
In Kubernetes, the cluster consists of:
A Control Plane (the brain of
Kubernetes).
Worker Nodes (the machines where
applications run).
The Control Plane is responsible for managing the
cluster, maintaining its desired state, and scheduling
workloads. It includes:
API Server:
Acts as the entry point for all administrative tasks. It
handles communication between the user (via CLI or UI)
and the cluster.
A - Kubernetes Master (Control Plane) :
Introduction to Kubernetes
Introduction to Kubernetes
36
Introduction to Kubernetes
Introduction to Kubernetes
Scheduler:
Decides which worker node will run a given pod based on
resource availability.
Controller Manager:
Ensures the desired state of the cluster by managing
controllers, like replicating pods or handling node
failures.
etcd:
A key-value store that holds the cluster's configuration
and state. It's critical for cluster consistency.
37
A - Kubernetes Master (Control Plane) :
These are the machines where your applications
actually run. Each worker node has:
Pods:
A pod is the smallest unit in Kubernetes. It runs
one or more containers.
Example: If you're running a web server, it will
be inside a pod.
B - Worker Nodes :
Introduction to Kubernetes
Introduction to Kubernetes
38
Kubelet:
The guardian of the node. It ensures that the
pod is healthy and running properly.
Kube-proxy:
Manages communication between different
parts of the cluster and the outside world.
Container Runtime (e.g., Docker):
This is the tool that runs the actual containers.
Introduction to Kubernetes
Introduction to Kubernetes
39
B - Worker Nodes :
Introduction to Kubernetes
Introduction to Kubernetes
3. Kubernetes YAML File Overview
A Kubernetes YAML file is used to
define resources and their
configurations in a Kubernetes cluster.
It is written in YAML syntax and is
structured with key-value pairs.
40
41
A - Key Sections in a Kubernetes YAML File:
apiVersion
Specifies the API version of the
Kubernetes resource.
Example: apps/v1, v1.
Introduction to Kubernetes
Introduction to Kubernetes
metadata
Contains metadata about the
resource.
spec
The main configuration of the
resource, varying by resource
type.
Introduction to Kubernetes
Introduction to Kubernetes
B - Communication Flow :
42
C - Example: Deploying a Django Web Application :
Introduction to Kubernetes
Introduction to Kubernetes
The API Server processes your deployment request via kubectl.
The Scheduler assigns your Django app to a worker node.
The Kubelet ensures the app container runs properly in a pod.
43
Liveness and readiness probes are checks that Kubernetes performs on your
pods to determine their health.
Liveness probes check if your application is still running, while readiness
probes check if your application is ready to receive traffic.
4. Kubernetes Probes ?
Introduction to Kubernetes
Introduction to Kubernetes
So you’ve built an amazing app and deployed it to
Kubernetes .
That’s where liveness and readiness probes come in.
But how do you make sure your app stays up and running as
intended?
44
45
Liveness probes check if your application is up and running.
They ensure that if a pod goes down for any reason,
Kubernetes can restart it and get your app back online.
There are three types of liveness probes:
1. HTTP probe: checks for a successful HTTP response
(status code 200–399). This is good for web apps and REST
APIs.
2. TCP probe: Checks if a TCP port is open. Use this for non-
HTTP apps.
3. Exec probe: Executes a command inside the container.
Checks the exit code to determine health.
Introduction to Kubernetes
Introduction to Kubernetes
A- Liveness Probes
46
Introduction to Kubernetes
Introduction to Kubernetes
Readiness probes check if your application pods are
ready to accept traffic.
If a readiness probe fails, Kubernetes will remove the
pod from service load balancers and endpoints.
This ensures that clients don’t access pods that are not
ready to handle requests.
Some examples of readiness probes include:
Checking if a web server returns a 200 OK response
on a certain endpoint
Seeing if a database connection can be established
B- Readiness Probes
47
Deploying a
48
A Dockerfile was created to containerize the
Django application :
Uses the Python 3.10 image.
Installs the dependencies specified in
requirements.txt.
Copies the project into the container and
exposes port 8000.
Configures the Django server startup to run
the application.
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
49
Dockerfile_Django
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
50
The docker-compose.yml file was created to orchestrate
the Django application with PostgreSQL :
Django Service : Based on the created Dockerfile, it
runs the web application, uses the volume named app
for storing necessary data, and is integrated into the
Docker network.
PostgreSQL Service : Uses the official PostgreSQL
image, with environment variables defining the
database parameters (user, password, name). It uses
the volume named db_data to ensure data
persistence.
docker-compose.yml
51
The command “docker-compose up --build” uses the Docker Compose tool to build the Docker image
specified in the Docker Compose file, then start the containers defined in it. The “--build” flag ensures
the latest changes are incorporated before starting the containers.
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
Devops with Docker and K8S + django example
53
This screenshot shows the process of building a Docker image from a Dockerfile for a Django application:
The docker build command is run to build the image using a file named Dockerfile_Django.
Steps Shown:
Docker pulls the base Python image,
Copies the necessary files,
Installs dependencies using pip,
And creates the final image.
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
Devops with Docker and K8S + django example
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
55
A namespace.yaml file was created
to define a namespace in
Kubernetes.
This namespace is named devops
and is used to organize and isolate
resources within the Kubernetes
cluster.
namespace.yaml
56
A db-deployment.yaml file was created to configure a
PostgreSQL deployment within Kubernetes :
Specification Details:
Replicas: Configured with a single replica.
Selector: Applies a selector with the label app:
postgres to match the deployment.
Pod Template: The template specifies a
PostgreSQL container.
Container Configuration:
Image: Uses the postgres:latest Docker image for
the container.
Port: Exposes port 5432 for database connections.
Environment Variables:
POSTGRES_USER: Set to "postgres".
POSTGRES_PASSWORD: Set to "postgres".
POSTGRES_DB: Set to "django_db".
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
db-deployement.yaml
57
A db-service.yaml file was created to configure a
Kubernetes service for a PostgreSQL database
Port Configuration:
Exposes Port: Exposes port 5432.
Redirects Port: Redirects port 5432 to the
target container port.
Selector: Matches pods labeled with app: postgres.
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
db-service.yaml
A File “django-deployment.yaml” was created to deploy a
Django application on Kubernetes :
Container Configuration:
Image: Uses ‘rami2708/devops-web’ image.
Port: Exposes port ‘8000’.
Environment Variables:
Configurations for PostgreSQL database
(username, password, database name, and host).
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
django-deployment.yaml
58
59
A django-service.yaml file was created to configure
a LoadBalancer service for the Django application :
Port Configuration:
Exposes Port: Exposes port 8000.
Redirects Port: Redirects port 8000 to the
target container port.
Selector: Matches pods labeled with app:
django.
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
django-service.yaml
Deploying a Django Application with Docker and K8S
Deploying a Django Application with Docker and K8S
60
Two pods are running:
pod/django-74cbf6cbbd-zg7xh
pod/postgres-7c77f684d7c-pm9j.
Two services are created:
service/db with a
ClusterIP
service/django with a
LoadBalancer.
Two deployments are running:
deployment.apps/django
deployment.apps/postgres
Two ReplicaSets are running:
replicaset.apps/django-74cbf6cbbd
replicaset.apps/postgres-7c77f684d7c.
Devops with Docker and K8S + django example
Devops with Docker and K8S + django example
Benefits of using
63
In
&
Benefits of using Docker
Benefits of using Docker
64
Benefits of using Kubernetes
Benefits of using Kubernetes
65
CONCLUSION
66
Conclusion
Conclusion
67
Using Docker and Kubernetes for Django app
deployment ensures scalability, consistency, and
efficiency. These tools modernize workflows,
making applications reliable and adaptable to
change.
Refrences
Refrences
68
https://devopscube.com/build-docker-image/
https://www.linkedin.com/posts/hasibulislamnirob_what-is-devops-pdf-activity-7132398073485410304-jDb1?
utm_source=share&utm_medium=member_desktop
https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-
up-health-checks-with-readiness-and-liveness-probes?hl=entext
www.clickittech.com
https://www.clickittech.com/devops/kubernetes-architecture-diagram/
69
THANK YOU FOR YOUR
ATTENTION
Introduction to Kubernetes
Introduction to Kubernetes
70
User Interface (UI) or CLI (kubectl) is used to send commands to the API Server.
The Scheduler allocates pods to specific nodes.
The Controller Manager maintains the cluster’s state.
Pods are created on worker nodes, and Kubelet ensures they run smoothly.
Kube-proxy manages network traffic between pods and services.
B - Communication Flow :
Ad

More Related Content

Similar to Devops with Docker and K8S + django example (20)

Container on azure
Container on azureContainer on azure
Container on azure
Vishwas N
 
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
Mars Devs
 
Using Docker container technology with F5 Networks products and services
Using Docker container technology with F5 Networks products and servicesUsing Docker container technology with F5 Networks products and services
Using Docker container technology with F5 Networks products and services
F5 Networks
 
CKA Training Online | Kubernetes Training in Ameerpet
CKA Training Online | Kubernetes Training in AmeerpetCKA Training Online | Kubernetes Training in Ameerpet
CKA Training Online | Kubernetes Training in Ameerpet
navyatejavisualpath
 
Docker Interview Questions
Docker Interview QuestionsDocker Interview Questions
Docker Interview Questions
Satyam Jaiswal
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
Ryuzaki360
 
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Katy Slemon
 
Containers and Kubernetes -Notes Leo
Containers and Kubernetes -Notes LeoContainers and Kubernetes -Notes Leo
Containers and Kubernetes -Notes Leo
Léopold Gault
 
Introduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker SwarmIntroduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker Swarm
An Nguyen
 
Docker In Cloud
Docker In CloudDocker In Cloud
Docker In Cloud
Santanu Pattanayak
 
Introduction to Dev Ops and Containerisation with Docker
Introduction to Dev Ops and Containerisation with DockerIntroduction to Dev Ops and Containerisation with Docker
Introduction to Dev Ops and Containerisation with Docker
Shakthi Weerasinghe
 
Docker OpenStack Cloud Foundry
Docker OpenStack Cloud FoundryDocker OpenStack Cloud Foundry
Docker OpenStack Cloud Foundry
Animesh Singh
 
DEVOPS UNIT 4 docker and services commands
DEVOPS UNIT 4  docker and services commandsDEVOPS UNIT 4  docker and services commands
DEVOPS UNIT 4 docker and services commands
billuandtanya
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
ICON UK EVENTS Limited
 
What is Docker & Why is it Getting Popular?
What is Docker & Why is it Getting Popular?What is Docker & Why is it Getting Popular?
What is Docker & Why is it Getting Popular?
Mars Devs
 
Docker
DockerDocker
Docker
Abhishek Tomar
 
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
sapnakumari503374
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
Ambassador Labs
 
Docker_Interview_Questions__Answers.pdf
Docker_Interview_Questions__Answers.pdfDocker_Interview_Questions__Answers.pdf
Docker_Interview_Questions__Answers.pdf
RifqiMultazamOfficia
 
How to Integrate Kubernetes in OpenStack
 How to Integrate Kubernetes in OpenStack  How to Integrate Kubernetes in OpenStack
How to Integrate Kubernetes in OpenStack
Meng-Ze Lee
 
Container on azure
Container on azureContainer on azure
Container on azure
Vishwas N
 
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
6 Steps Functionality Hacks To Kubernetes - 2023 Update.pdf
Mars Devs
 
Using Docker container technology with F5 Networks products and services
Using Docker container technology with F5 Networks products and servicesUsing Docker container technology with F5 Networks products and services
Using Docker container technology with F5 Networks products and services
F5 Networks
 
CKA Training Online | Kubernetes Training in Ameerpet
CKA Training Online | Kubernetes Training in AmeerpetCKA Training Online | Kubernetes Training in Ameerpet
CKA Training Online | Kubernetes Training in Ameerpet
navyatejavisualpath
 
Docker Interview Questions
Docker Interview QuestionsDocker Interview Questions
Docker Interview Questions
Satyam Jaiswal
 
KubernetesPPT.pptx
KubernetesPPT.pptxKubernetesPPT.pptx
KubernetesPPT.pptx
Ryuzaki360
 
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Kubernetes Vs. Docker Swarm: Comparing the Best Container Orchestration Tool ...
Katy Slemon
 
Containers and Kubernetes -Notes Leo
Containers and Kubernetes -Notes LeoContainers and Kubernetes -Notes Leo
Containers and Kubernetes -Notes Leo
Léopold Gault
 
Introduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker SwarmIntroduction To Docker, Docker Compose, Docker Swarm
Introduction To Docker, Docker Compose, Docker Swarm
An Nguyen
 
Introduction to Dev Ops and Containerisation with Docker
Introduction to Dev Ops and Containerisation with DockerIntroduction to Dev Ops and Containerisation with Docker
Introduction to Dev Ops and Containerisation with Docker
Shakthi Weerasinghe
 
Docker OpenStack Cloud Foundry
Docker OpenStack Cloud FoundryDocker OpenStack Cloud Foundry
Docker OpenStack Cloud Foundry
Animesh Singh
 
DEVOPS UNIT 4 docker and services commands
DEVOPS UNIT 4  docker and services commandsDEVOPS UNIT 4  docker and services commands
DEVOPS UNIT 4 docker and services commands
billuandtanya
 
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ....docker : How to deploy Digital Experience in a container, drinking a cup of ...
.docker : How to deploy Digital Experience in a container, drinking a cup of ...
ICON UK EVENTS Limited
 
What is Docker & Why is it Getting Popular?
What is Docker & Why is it Getting Popular?What is Docker & Why is it Getting Popular?
What is Docker & Why is it Getting Popular?
Mars Devs
 
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
Harnessing Containerization and Orchestration in DevOps: A Deep Dive into Doc...
sapnakumari503374
 
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOpsDevOps Days Boston 2017: Real-world Kubernetes for DevOps
DevOps Days Boston 2017: Real-world Kubernetes for DevOps
Ambassador Labs
 
Docker_Interview_Questions__Answers.pdf
Docker_Interview_Questions__Answers.pdfDocker_Interview_Questions__Answers.pdf
Docker_Interview_Questions__Answers.pdf
RifqiMultazamOfficia
 
How to Integrate Kubernetes in OpenStack
 How to Integrate Kubernetes in OpenStack  How to Integrate Kubernetes in OpenStack
How to Integrate Kubernetes in OpenStack
Meng-Ze Lee
 

Recently uploaded (20)

K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...Multi-currency in odoo accounting and Update exchange rates automatically in ...
Multi-currency in odoo accounting and Update exchange rates automatically in ...
Celine George
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam SuccessUltimate VMware 2V0-11.25 Exam Dumps for Exam Success
Ultimate VMware 2V0-11.25 Exam Dumps for Exam Success
Mark Soia
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Ad

Devops with Docker and K8S + django example

  • 1. DEVOPS WITH DOCKER AND KUBERNETES SOA presentation 1 2024-2025
  • 2. Deploying a Django Application Introduction to DevOps 01 Understanding Docker 02 Introduction to Kubernetes 03 Benefits of Docker and Kubernetes in DevOps Conclusion 04 05 06 Table of Table of contents contents 2
  • 4. Introduction to DevOps Introduction to DevOps 4 Why DevOps is revolutionizing software development ?
  • 5. Introduction to DevOps Introduction to DevOps 5 Why DevOps is revolutionizing software development ?
  • 6. Introduction to DevOps Introduction to DevOps 6 Why DevOps is revolutionizing software development ?
  • 7. Introduction to DevOps Introduction to DevOps 7 Why DevOps is revolutionizing software development ?
  • 8. 8 Introduction to DevOps Introduction to DevOps Who Introduced DevOps and When? Patrick Debois DevOpsDays conference the "Father of DevOps” 2009
  • 9. Introduction to DevOps Introduction to DevOps 9 Why DevOps is revolutionizing software development ? Devops is not a technology, tool or framework . DevOps is a cultural movement, mindset, philosophy to coordiante produce better, more reliable products. by automating infrastructure, workflow, and continuously measuring application performance for which they use a lot of tools.
  • 10. Introduction to DevOps Introduction to DevOps 10 Why DevOps is revolutionizing software development ? The DEVOPS lifecycle : You can visualize a Devops process as an infinite loop, comprising the illustrated steps through feedback --plan , which resets the loop.
  • 12. Understanding Docker Understanding Docker 12 What is Docker ? 1. Docker is a powerful platform that simplifies the process of building, shipping, and running applications.
  • 13. Understanding Docker Understanding Docker 13 Solomon Hykes 1.1 - History of docker :
  • 16. Understanding Docker Understanding Docker 16 1.4 - The Process of Creating Containers
  • 17. Definition: Scripts used to create Docker images. Purpose: Automates and ensures repeatable, consistent image creation. Structure: A text file containing a series of commands that Docker uses to assemble an image 2. DockerFile : Understanding Docker Understanding Docker 17
  • 18. 3. Docker image : These are the blueprints of applications. A Docker image is a lightweight, standalone, and executable package that includes everything needed to run a piece of software . Images are immutable, meaning once they’re created, they don’t change. Understanding Docker Understanding Docker 18
  • 20. 4. Docker container : A Docker container is like that lunchbox self-sufficient and portable. Imagine you have a lunchbox that contains everything you need for a meal. Understanding Docker Understanding Docker 20
  • 21. Toss it, and it leaves no mess. Stop the container, and it leaves no mess. Multiple containers on a host Multiple lunchboxes in your backpack. You can have When you're done Understanding Docker Understanding Docker 21
  • 22. Docker containers are runnable instances of Docker images. They encapsulate the application and its dependencies, providing an isolated environment for execution. Containers can be created, started, stopped, moved, and deleted using Docker commands. 4. Docker container : So, what’s a docker container ? Understanding Docker Understanding Docker 22
  • 23. 5. Docker compose : Understanding Docker Understanding Docker 23
  • 24. Docker Compose is a tool for defining and running multi-container Docker applications. It uses a YAML file (docker-compose.yml) to specify services, networks, volumes, and other configurations required for the application. 5. Docker compose : Understanding Docker Understanding Docker 24
  • 25. 25 6. Docker Volumes: Understanding Docker Understanding Docker
  • 26. 26 7. Docker Networking: Understanding Docker Understanding Docker
  • 27. Docker Hub is a cloud-based repository service provided by Docker for storing and sharing Docker images. It serves as a central hub for the Docker community, offering access to thousands of public images and enabling collaboration among developers and operations teams. Understanding Docker Understanding Docker 8. DOCKER HUB : 27
  • 28. Before Docker Hub Lack of Standardization No Centralized Storage Collaboration Barriers Limited Automation Quality Control Issues 8. DOCKER HUB : Understanding Docker Understanding Docker 28
  • 29. Searching for Images: Use the docker search command to search for images on Docker Hub: Pulling Images: Pull Docker images from Docker Hub using the docker pull command: Pushing Images: Push local Docker images to Docker Hub using the docker push command : Understanding Docker Understanding Docker 8. DOCKER HUB : 29
  • 31. Introduction to Kubernetes Introduction to Kubernetes 31 What is Kubernetes ? 1. Kubernetes, or K8s, is an open- source platform designed to automate the deployment, management, and scaling of containerized applications.
  • 32. 32 Created by Google, now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes is tailored for modern, container-based environments, such as those orchestrated with Docker 2014 2015 Introduction to Kubernetes Introduction to Kubernetes
  • 33. Key Purposes of Kubernetes
  • 34. 34 2.Kubernetes Architecture Introduction to Kubernetes Introduction to Kubernetes
  • 35. Introduction to Kubernetes Introduction to Kubernetes 35 What is a Cluster ? A group of computers (physical or virtual) that work together as a system. In Kubernetes, the cluster consists of: A Control Plane (the brain of Kubernetes). Worker Nodes (the machines where applications run).
  • 36. The Control Plane is responsible for managing the cluster, maintaining its desired state, and scheduling workloads. It includes: API Server: Acts as the entry point for all administrative tasks. It handles communication between the user (via CLI or UI) and the cluster. A - Kubernetes Master (Control Plane) : Introduction to Kubernetes Introduction to Kubernetes 36
  • 37. Introduction to Kubernetes Introduction to Kubernetes Scheduler: Decides which worker node will run a given pod based on resource availability. Controller Manager: Ensures the desired state of the cluster by managing controllers, like replicating pods or handling node failures. etcd: A key-value store that holds the cluster's configuration and state. It's critical for cluster consistency. 37 A - Kubernetes Master (Control Plane) :
  • 38. These are the machines where your applications actually run. Each worker node has: Pods: A pod is the smallest unit in Kubernetes. It runs one or more containers. Example: If you're running a web server, it will be inside a pod. B - Worker Nodes : Introduction to Kubernetes Introduction to Kubernetes 38
  • 39. Kubelet: The guardian of the node. It ensures that the pod is healthy and running properly. Kube-proxy: Manages communication between different parts of the cluster and the outside world. Container Runtime (e.g., Docker): This is the tool that runs the actual containers. Introduction to Kubernetes Introduction to Kubernetes 39 B - Worker Nodes :
  • 40. Introduction to Kubernetes Introduction to Kubernetes 3. Kubernetes YAML File Overview A Kubernetes YAML file is used to define resources and their configurations in a Kubernetes cluster. It is written in YAML syntax and is structured with key-value pairs. 40
  • 41. 41 A - Key Sections in a Kubernetes YAML File: apiVersion Specifies the API version of the Kubernetes resource. Example: apps/v1, v1. Introduction to Kubernetes Introduction to Kubernetes metadata Contains metadata about the resource. spec The main configuration of the resource, varying by resource type.
  • 42. Introduction to Kubernetes Introduction to Kubernetes B - Communication Flow : 42
  • 43. C - Example: Deploying a Django Web Application : Introduction to Kubernetes Introduction to Kubernetes The API Server processes your deployment request via kubectl. The Scheduler assigns your Django app to a worker node. The Kubelet ensures the app container runs properly in a pod. 43
  • 44. Liveness and readiness probes are checks that Kubernetes performs on your pods to determine their health. Liveness probes check if your application is still running, while readiness probes check if your application is ready to receive traffic. 4. Kubernetes Probes ? Introduction to Kubernetes Introduction to Kubernetes So you’ve built an amazing app and deployed it to Kubernetes . That’s where liveness and readiness probes come in. But how do you make sure your app stays up and running as intended? 44
  • 45. 45
  • 46. Liveness probes check if your application is up and running. They ensure that if a pod goes down for any reason, Kubernetes can restart it and get your app back online. There are three types of liveness probes: 1. HTTP probe: checks for a successful HTTP response (status code 200–399). This is good for web apps and REST APIs. 2. TCP probe: Checks if a TCP port is open. Use this for non- HTTP apps. 3. Exec probe: Executes a command inside the container. Checks the exit code to determine health. Introduction to Kubernetes Introduction to Kubernetes A- Liveness Probes 46
  • 47. Introduction to Kubernetes Introduction to Kubernetes Readiness probes check if your application pods are ready to accept traffic. If a readiness probe fails, Kubernetes will remove the pod from service load balancers and endpoints. This ensures that clients don’t access pods that are not ready to handle requests. Some examples of readiness probes include: Checking if a web server returns a 200 OK response on a certain endpoint Seeing if a database connection can be established B- Readiness Probes 47
  • 49. A Dockerfile was created to containerize the Django application : Uses the Python 3.10 image. Installs the dependencies specified in requirements.txt. Copies the project into the container and exposes port 8000. Configures the Django server startup to run the application. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S 49 Dockerfile_Django
  • 50. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S 50 The docker-compose.yml file was created to orchestrate the Django application with PostgreSQL : Django Service : Based on the created Dockerfile, it runs the web application, uses the volume named app for storing necessary data, and is integrated into the Docker network. PostgreSQL Service : Uses the official PostgreSQL image, with environment variables defining the database parameters (user, password, name). It uses the volume named db_data to ensure data persistence. docker-compose.yml
  • 51. 51 The command “docker-compose up --build” uses the Docker Compose tool to build the Docker image specified in the Docker Compose file, then start the containers defined in it. The “--build” flag ensures the latest changes are incorporated before starting the containers. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S
  • 53. 53 This screenshot shows the process of building a Docker image from a Dockerfile for a Django application: The docker build command is run to build the image using a file named Dockerfile_Django. Steps Shown: Docker pulls the base Python image, Copies the necessary files, Installs dependencies using pip, And creates the final image. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S
  • 55. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S 55 A namespace.yaml file was created to define a namespace in Kubernetes. This namespace is named devops and is used to organize and isolate resources within the Kubernetes cluster. namespace.yaml
  • 56. 56 A db-deployment.yaml file was created to configure a PostgreSQL deployment within Kubernetes : Specification Details: Replicas: Configured with a single replica. Selector: Applies a selector with the label app: postgres to match the deployment. Pod Template: The template specifies a PostgreSQL container. Container Configuration: Image: Uses the postgres:latest Docker image for the container. Port: Exposes port 5432 for database connections. Environment Variables: POSTGRES_USER: Set to "postgres". POSTGRES_PASSWORD: Set to "postgres". POSTGRES_DB: Set to "django_db". Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S db-deployement.yaml
  • 57. 57 A db-service.yaml file was created to configure a Kubernetes service for a PostgreSQL database Port Configuration: Exposes Port: Exposes port 5432. Redirects Port: Redirects port 5432 to the target container port. Selector: Matches pods labeled with app: postgres. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S db-service.yaml
  • 58. A File “django-deployment.yaml” was created to deploy a Django application on Kubernetes : Container Configuration: Image: Uses ‘rami2708/devops-web’ image. Port: Exposes port ‘8000’. Environment Variables: Configurations for PostgreSQL database (username, password, database name, and host). Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S django-deployment.yaml 58
  • 59. 59 A django-service.yaml file was created to configure a LoadBalancer service for the Django application : Port Configuration: Exposes Port: Exposes port 8000. Redirects Port: Redirects port 8000 to the target container port. Selector: Matches pods labeled with app: django. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S django-service.yaml
  • 60. Deploying a Django Application with Docker and K8S Deploying a Django Application with Docker and K8S 60 Two pods are running: pod/django-74cbf6cbbd-zg7xh pod/postgres-7c77f684d7c-pm9j. Two services are created: service/db with a ClusterIP service/django with a LoadBalancer. Two deployments are running: deployment.apps/django deployment.apps/postgres Two ReplicaSets are running: replicaset.apps/django-74cbf6cbbd replicaset.apps/postgres-7c77f684d7c.
  • 64. Benefits of using Docker Benefits of using Docker 64
  • 65. Benefits of using Kubernetes Benefits of using Kubernetes 65
  • 67. Conclusion Conclusion 67 Using Docker and Kubernetes for Django app deployment ensures scalability, consistency, and efficiency. These tools modernize workflows, making applications reliable and adaptable to change.
  • 69. 69 THANK YOU FOR YOUR ATTENTION
  • 70. Introduction to Kubernetes Introduction to Kubernetes 70 User Interface (UI) or CLI (kubectl) is used to send commands to the API Server. The Scheduler allocates pods to specific nodes. The Controller Manager maintains the cluster’s state. Pods are created on worker nodes, and Kubelet ensures they run smoothly. Kube-proxy manages network traffic between pods and services. B - Communication Flow :