SlideShare a Scribd company logo
Deployment Strategies & Tools
> whoami
- @abdennour
- Starting with k8s on AWS at 2017
> kubectl get agenda
- Intro
- Why Deployment ?
- What’s Deployment ?
- How Deployment?
- Deployment Strategies ( in general & in k8s )
- Deployment Features
- Demo ( distributed )
Intro
Intro – Lab Env for Demos
abdennour/sample-app:v1 abdennour/sample-app:v2 abdennour/sample-app:blue abdennour/sample-app:green
kubectl port-forward : access Pod from localhost
Intro – Horizontal Scaling & Replication
Pod Replication : Having many Pods with the
same definition (except "name”)
Replication Controller: maintain a stable set of
replica Pods running at any given time
ReplicaSet is the Replication Controller here
Name of Pods created by ReplicaSet follow this
format <replicaset-name>-<random-string>
3 ways to Scale out/in :
- change yaml, then kubectl apply
- Kubectl edit replicaset
- Kubectl scale replicaset .. –replicas X
Pod
Pod
Pod
Pod
ReplicaSet (app)
Desired=4, current=4
app-jmcgh
app-sgc25
app-xjfe2l
app-shxn4
Intro - Service
Always communicate with Pod thru Service
Pods are ephemeral in nature
k8s Service : Forward Traffic to Pod using
Lables & Selectors .
Service Forwards traffic to Pods
Service
Pod
Pod
Pod
Pod
Service
name=x,
namespace=app
Port=80
è http://x.app
Intro – Replication & Service Together
ReplicaSet replicates Pods with same Labels
Because all replicas has same labels, A service
with Selectors=Labels can forward traffic in
round-robin way.
è Service behaves like loadbalancer for
replicas ( pods With the same labels )
Service Forwards traffic to Pods
Service
Pod
Pod
Pod
Pod
ReplicaSet (app)
Desired=4, current=4
Why Deployment?
Why Deployment ?
Scenario:
You deployed an app few days ago.
Now you want to upgrade your app from v1 to v2.
Challenges:
● Can you upgrade with Zero downtime?
● Can you upgrade replicas sequentially one after another?
● Can you pause and resume upgrade process?
● Rollback upgrade to previous stable release
What’s Deployment ?
What’s Deployment ?
In General:
● Deployment is all of the activities that make a software system available for
use
● Deployment First Release vs Deployment Subsequent Releases
è First Installation vs Subsequent Upgrades
In Kubernetes:
● Deployment is automated using Controllers
○ Deployment controller
○ ReplicaSetController
What’s Deployment
Controllers for Pods Controllers Graph – Focus on Deployment
What’s Deployment
ReplicaSet : Pod Template + Replication
Deployment: ReplicaSet Template + Update Strategy
è Deployment : Pod Template + Replication + Deployment Strategy
è Name Of Pods Created by Deployment follow this format :
<deployment-name>-<replicaset-name>-<random-string>
How Deployment ?
How Deployment
Deployment Anatomy ‫ﺗ‬‫ﺸ‬‫ﺮ‬‫ﯾ‬‫ﺢ‬
- Replication
- Deployment Strategy
- Pod Template
Deployment Strategies
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Easy to Setup <> Expect Downtime
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Easy to Setup <> Rollout/Rollback take time
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Same as ROLLING UPDATE But :
- Increase number of replicas before
start the upgrade
e.g:
- v1 with 3 replicas
- Scale out from 3 to 5 replicas
- Start rolling update v2
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Instant Rollback <> Expensive
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Fast Rollback <> Slow Rollout
Deployment Strategies
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Deployment Strategies with k8s Deployment
● Recreate
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
- Create new Replica Set for v2
- Scale out new replica Set v2 to max
- Scale down existing replica set (v1) to 0
Deployment Strategies with k8s Deployment
● Recreate
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
K8s gradually replaces existing pods in batches
- Create new Replica Set for v2
- Scale out new replica Set v2 gradually
- Scale in existing replica set v1 gradually
- Scale in existing replica set (v1) to 0
Deployment Strategies with k8s Deployment
● Recreate:
● Rolling Update (Ramped or
incremental)
● Rolling update with Additional
batch
● Blue/Green
● Canary
● A/B testing
Deployment Features
Features of Deployment
● Multiple Replicas
● Upgrade
● Rollback
● Scale Up or Down
● Pause & Resume
‫ﺷ‬‫ﻜ‬‫ﺮ‬‫ا‬‫ﻋ‬‫ﻠ‬‫ﻰ‬‫ا‬‫ﻟ‬‫ﻤ‬‫ﺸ‬‫ﺎ‬‫ر‬‫ﻛ‬‫ﺔ‬‫و‬‫ا‬‫ﻟ‬‫ﻤ‬‫ﺘ‬‫ﺎ‬‫ﺑ‬‫ﻌ‬‫ﺔ‬
Appendix : Statefulset vs Deployment
•A StatefulSet is another Kubernetes controller that manages pods just like Deployments.
But it differs from a Deployment in that it is more suited for stateful apps.
•A stateful application requires pods with a unique identity (for example, hostname). One
pod should be able to reach other pods with well-defined names.
•For a StatefulSet to work, it needs a Headless Service. A Headless Service does not have
an IP address. Internally, it creates the necessary endpoints to expose pods with DNS
names. The StatefulSet definition includes a reference to the Headless Service, but you
have to create it separately.
•By nature, a StatefulSet needs persistent storage so that the hosted application saves its
state and data across restarts. Kubernetes provides Storage Classes, Persistent Volumes,
and Persistent Volume Claims to provide an abstraction layer above the cloud provider’s
storage-offering mechanism.
•Once the StatefulSet and the Headless Service are created, a pod can access another one
by name prefixed with the service name.

More Related Content

What's hot

Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Eueung Mulyana
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
Bob Killen
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
Ryan Jarvinen
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
VMware Tanzu
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Martin Danielsson
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operations
Mariano Cunietti
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
Omar Fathy
 
OpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdfOpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdf
JuanSalinas593459
 
GitOps w/argocd
GitOps w/argocdGitOps w/argocd
GitOps w/argocd
Jean-Philippe Bélanger
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
Jeeva Chelladhurai
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
Gabriel Carro
 
Kubernetes
KubernetesKubernetes
Kubernetes
Meng-Ze Lee
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
Krishna-Kumar
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
Julian Mazzitelli
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdf
amanmakwana3
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
Rishabh Indoria
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdf
ssuser31375f
 

What's hot (20)

Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
Getting Started with Kubernetes
Getting Started with Kubernetes Getting Started with Kubernetes
Getting Started with Kubernetes
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Gitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operationsGitops: a new paradigm for software defined operations
Gitops: a new paradigm for software defined operations
 
GitOps and ArgoCD
GitOps and ArgoCDGitOps and ArgoCD
GitOps and ArgoCD
 
OpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdfOpenShift-Technical-Overview.pdf
OpenShift-Technical-Overview.pdf
 
GitOps w/argocd
GitOps w/argocdGitOps w/argocd
GitOps w/argocd
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Kubernetes a comprehensive overview
Kubernetes   a comprehensive overviewKubernetes   a comprehensive overview
Kubernetes a comprehensive overview
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Designing a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd productsDesigning a complete ci cd pipeline using argo events, workflow and cd products
Designing a complete ci cd pipeline using argo events, workflow and cd products
 
ArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdfArgoCD Meetup PPT final.pdf
ArgoCD Meetup PPT final.pdf
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
GitOps 101 Presentation.pdf
GitOps 101 Presentation.pdfGitOps 101 Presentation.pdf
GitOps 101 Presentation.pdf
 

Similar to Kubernetes Deployment Strategies

DevOps Summit 2016 - The immutable Journey
DevOps Summit 2016 - The immutable JourneyDevOps Summit 2016 - The immutable Journey
DevOps Summit 2016 - The immutable Journey
smalltown
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB
 
Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24
Sam Zheng
 
Production Grade Kubernetes Applications
Production Grade Kubernetes ApplicationsProduction Grade Kubernetes Applications
Production Grade Kubernetes Applications
Narayanan Krishnamurthy
 
K8s
K8sK8s
AWS ECS workshop
AWS ECS workshopAWS ECS workshop
AWS ECS workshop
Prashant Kalkar
 
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for KubernetesDocker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Andrew Phillips
 
Using kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersUsing kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containers
josfuecas
 
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Edureka!
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Codemotion
 
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
onsitan
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
Piotr Perzyna
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
Terry Chen
 
JupyterHub + kubernetes
JupyterHub + kubernetesJupyterHub + kubernetes
JupyterHub + kubernetes
Carol Willing
 
Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6
Harshal Shah
 
What's new in Kubernetes
What's new in KubernetesWhat's new in Kubernetes
What's new in Kubernetes
Daniel Smith
 
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
Łukasz Piątkowski
 
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEOClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
Altinity Ltd
 
How to Handle your Kubernetes Upgrades
How to Handle your Kubernetes UpgradesHow to Handle your Kubernetes Upgrades
How to Handle your Kubernetes Upgrades
CloudOps2005
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
Sjuul Janssen
 

Similar to Kubernetes Deployment Strategies (20)

DevOps Summit 2016 - The immutable Journey
DevOps Summit 2016 - The immutable JourneyDevOps Summit 2016 - The immutable Journey
DevOps Summit 2016 - The immutable Journey
 
MongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James BroadheadMongoDB Ops Manager and Kubernetes - James Broadhead
MongoDB Ops Manager and Kubernetes - James Broadhead
 
Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24Introduction kubernetes 2017_12_24
Introduction kubernetes 2017_12_24
 
Production Grade Kubernetes Applications
Production Grade Kubernetes ApplicationsProduction Grade Kubernetes Applications
Production Grade Kubernetes Applications
 
K8s
K8sK8s
K8s
 
AWS ECS workshop
AWS ECS workshopAWS ECS workshop
AWS ECS workshop
 
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for KubernetesDocker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
Docker New York City: From GitOps to a scalable CI/CD Pattern for Kubernetes
 
Using kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containersUsing kubernetes to lose your fear of using containers
Using kubernetes to lose your fear of using containers
 
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
Kubernetes Deployment Tutorial | Kubernetes Tutorial For Beginners | Kubernet...
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
 
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
Drupal and Container Orchestration - Using Kubernetes to Manage All the Thing...
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
 
JupyterHub + kubernetes
JupyterHub + kubernetesJupyterHub + kubernetes
JupyterHub + kubernetes
 
Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6Kubernetes101 - Pune Kubernetes Meetup 6
Kubernetes101 - Pune Kubernetes Meetup 6
 
What's new in Kubernetes
What's new in KubernetesWhat's new in Kubernetes
What's new in Kubernetes
 
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
 
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEOClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
ClickHouse on Kubernetes! By Robert Hodges, Altinity CEO
 
How to Handle your Kubernetes Upgrades
How to Handle your Kubernetes UpgradesHow to Handle your Kubernetes Upgrades
How to Handle your Kubernetes Upgrades
 
Kubernetes workshop -_the_basics
Kubernetes workshop -_the_basicsKubernetes workshop -_the_basics
Kubernetes workshop -_the_basics
 

More from Abdennour TM

Helm Charts 101 - Simply Kubernetes Apps deployment
Helm Charts 101 - Simply Kubernetes Apps deploymentHelm Charts 101 - Simply Kubernetes Apps deployment
Helm Charts 101 - Simply Kubernetes Apps deployment
Abdennour TM
 
4.machineLearning_with_BigData
4.machineLearning_with_BigData4.machineLearning_with_BigData
4.machineLearning_with_BigData
Abdennour TM
 
3.bigdata_analytics
3.bigdata_analytics3.bigdata_analytics
3.bigdata_analytics
Abdennour TM
 
2.Hadoop_Platform_applications_framework_certificate
2.Hadoop_Platform_applications_framework_certificate2.Hadoop_Platform_applications_framework_certificate
2.Hadoop_Platform_applications_framework_certificate
Abdennour TM
 
1.introduction_to_big_data_certificate
1.introduction_to_big_data_certificate1.introduction_to_big_data_certificate
1.introduction_to_big_data_certificate
Abdennour TM
 
AbdennourTOUMI_SCLA_ECR
AbdennourTOUMI_SCLA_ECRAbdennourTOUMI_SCLA_ECR
AbdennourTOUMI_SCLA_ECR
Abdennour TM
 

More from Abdennour TM (6)

Helm Charts 101 - Simply Kubernetes Apps deployment
Helm Charts 101 - Simply Kubernetes Apps deploymentHelm Charts 101 - Simply Kubernetes Apps deployment
Helm Charts 101 - Simply Kubernetes Apps deployment
 
4.machineLearning_with_BigData
4.machineLearning_with_BigData4.machineLearning_with_BigData
4.machineLearning_with_BigData
 
3.bigdata_analytics
3.bigdata_analytics3.bigdata_analytics
3.bigdata_analytics
 
2.Hadoop_Platform_applications_framework_certificate
2.Hadoop_Platform_applications_framework_certificate2.Hadoop_Platform_applications_framework_certificate
2.Hadoop_Platform_applications_framework_certificate
 
1.introduction_to_big_data_certificate
1.introduction_to_big_data_certificate1.introduction_to_big_data_certificate
1.introduction_to_big_data_certificate
 
AbdennourTOUMI_SCLA_ECR
AbdennourTOUMI_SCLA_ECRAbdennourTOUMI_SCLA_ECR
AbdennourTOUMI_SCLA_ECR
 

Recently uploaded

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 

Recently uploaded (20)

National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 

Kubernetes Deployment Strategies

  • 2. > whoami - @abdennour - Starting with k8s on AWS at 2017
  • 3. > kubectl get agenda - Intro - Why Deployment ? - What’s Deployment ? - How Deployment? - Deployment Strategies ( in general & in k8s ) - Deployment Features - Demo ( distributed )
  • 5. Intro – Lab Env for Demos abdennour/sample-app:v1 abdennour/sample-app:v2 abdennour/sample-app:blue abdennour/sample-app:green kubectl port-forward : access Pod from localhost
  • 6. Intro – Horizontal Scaling & Replication Pod Replication : Having many Pods with the same definition (except "name”) Replication Controller: maintain a stable set of replica Pods running at any given time ReplicaSet is the Replication Controller here Name of Pods created by ReplicaSet follow this format <replicaset-name>-<random-string> 3 ways to Scale out/in : - change yaml, then kubectl apply - Kubectl edit replicaset - Kubectl scale replicaset .. –replicas X Pod Pod Pod Pod ReplicaSet (app) Desired=4, current=4 app-jmcgh app-sgc25 app-xjfe2l app-shxn4
  • 7. Intro - Service Always communicate with Pod thru Service Pods are ephemeral in nature k8s Service : Forward Traffic to Pod using Lables & Selectors . Service Forwards traffic to Pods Service Pod Pod Pod Pod Service name=x, namespace=app Port=80 è http://x.app
  • 8. Intro – Replication & Service Together ReplicaSet replicates Pods with same Labels Because all replicas has same labels, A service with Selectors=Labels can forward traffic in round-robin way. è Service behaves like loadbalancer for replicas ( pods With the same labels ) Service Forwards traffic to Pods Service Pod Pod Pod Pod ReplicaSet (app) Desired=4, current=4
  • 10. Why Deployment ? Scenario: You deployed an app few days ago. Now you want to upgrade your app from v1 to v2. Challenges: ● Can you upgrade with Zero downtime? ● Can you upgrade replicas sequentially one after another? ● Can you pause and resume upgrade process? ● Rollback upgrade to previous stable release
  • 12. What’s Deployment ? In General: ● Deployment is all of the activities that make a software system available for use ● Deployment First Release vs Deployment Subsequent Releases è First Installation vs Subsequent Upgrades In Kubernetes: ● Deployment is automated using Controllers ○ Deployment controller ○ ReplicaSetController
  • 13. What’s Deployment Controllers for Pods Controllers Graph – Focus on Deployment
  • 14. What’s Deployment ReplicaSet : Pod Template + Replication Deployment: ReplicaSet Template + Update Strategy è Deployment : Pod Template + Replication + Deployment Strategy è Name Of Pods Created by Deployment follow this format : <deployment-name>-<replicaset-name>-<random-string>
  • 16. How Deployment Deployment Anatomy ‫ﺗ‬‫ﺸ‬‫ﺮ‬‫ﯾ‬‫ﺢ‬ - Replication - Deployment Strategy - Pod Template
  • 18. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing Easy to Setup <> Expect Downtime
  • 19. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing Easy to Setup <> Rollout/Rollback take time
  • 20. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing Same as ROLLING UPDATE But : - Increase number of replicas before start the upgrade e.g: - v1 with 3 replicas - Scale out from 3 to 5 replicas - Start rolling update v2
  • 21. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing Instant Rollback <> Expensive
  • 22. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing Fast Rollback <> Slow Rollout
  • 23. Deployment Strategies ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing
  • 24. Deployment Strategies with k8s Deployment ● Recreate ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing - Create new Replica Set for v2 - Scale out new replica Set v2 to max - Scale down existing replica set (v1) to 0
  • 25. Deployment Strategies with k8s Deployment ● Recreate ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing K8s gradually replaces existing pods in batches - Create new Replica Set for v2 - Scale out new replica Set v2 gradually - Scale in existing replica set v1 gradually - Scale in existing replica set (v1) to 0
  • 26. Deployment Strategies with k8s Deployment ● Recreate: ● Rolling Update (Ramped or incremental) ● Rolling update with Additional batch ● Blue/Green ● Canary ● A/B testing
  • 28. Features of Deployment ● Multiple Replicas ● Upgrade ● Rollback ● Scale Up or Down ● Pause & Resume
  • 30. Appendix : Statefulset vs Deployment •A StatefulSet is another Kubernetes controller that manages pods just like Deployments. But it differs from a Deployment in that it is more suited for stateful apps. •A stateful application requires pods with a unique identity (for example, hostname). One pod should be able to reach other pods with well-defined names. •For a StatefulSet to work, it needs a Headless Service. A Headless Service does not have an IP address. Internally, it creates the necessary endpoints to expose pods with DNS names. The StatefulSet definition includes a reference to the Headless Service, but you have to create it separately. •By nature, a StatefulSet needs persistent storage so that the hosted application saves its state and data across restarts. Kubernetes provides Storage Classes, Persistent Volumes, and Persistent Volume Claims to provide an abstraction layer above the cloud provider’s storage-offering mechanism. •Once the StatefulSet and the Headless Service are created, a pod can access another one by name prefixed with the service name.