DevOps Classroom notes 10/Oct/2026

K8s Deployment Strategies:

  • To Move or update one version to another version
  1. Recreat:
  • Kill all old pods at once and create new pods
  • Will have down time
flowchart LR
    A[v1 v1 v1] --> B[all stopped - downtime] --> C[v2 v2 v2]

spec:
  Strategy:
     type: recreate
  1. Rolling Update:
  • it is default upgrade Strategie in k8s deployment
  • pods will be replace gradually , a few min of time
  • No downtime
flowchart LR
    S1[v1 v1 v1 v1] --> S2[v1 v1 v1 v2] --> S3[v1 v1 v2 v2] --> S4[v1 v2 v2 v2] --> S5[v2 v2 v2 v2]
spec:
  replicas: 4
  Strategy:
    type: RollingUpdate
    RollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  1. Bule/green Deployment:
  • Run Two full versions , switch traffic by changing the service selector
flowchart LR
    U[Users] --> SVC[Service<br/>selector: version=blue]
    SVC --> B[Blue v1 - live]
    G[Green v2 - idle/testing]
    SVC -. switch selector .-> G
  1. Canary deployement:
  • creating pods and load will be distubuted by %
  • Traffic will divided by Ratio
  • No downtime
flowchart LR
    U[Users] --> SVC[Service<br/>selector: app=myapp]
    SVC -->|~90%| S[Stable v1 x 9 Pods]
    SVC -->|~10%| C[Canary v2 x 1 Pod]
  1. A/B Testing:
  • it is similar as Canary deployment , based on request it will create group and random percentage to scale the new version
flowchart LR
    U[Request] --> R{Router<br/>header / cookie?}
    R -->|group A| A[v1]
    R -->|group B| B[v2]
  1. Shadow:
  • copy the traffic to new version
  • safer to test work loads
  • it is required service mesh or proxy configuration.
flowchart LR
    U[Users] --> P[Proxy / Mesh]
    P --> V1[v1 - responds to users]
    P -. mirrored copy .-> V2[v2 - response ignored]

Choosing the Right Strategy

Situation Strategy
Dev/test, downtime acceptable Recreate
Normal production release Rolling Update
Need instant rollback, can afford 2x resources Blue/Green
Risky change, want gradual exposure Canary
Compare features by user group A/B Testing
Validate under real traffic with zero risk Shadow

Task:

  1. create deployment using api referance Deployment API Offical docs
  2. create new deployment Strategies like recreat , rolling update bule-green methods
  3. try from apps , like jenkins , nop, apache2 , nginx
docker run -d -v jenkins_home:/var/jenkins_home -p 8080:8080 -p 50000:50000 --restart=on-failure jenkins/jenkins:lts-jdk21

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube