Kubernetes Deployment Stratagies (original) (raw)

Last Updated : 28 Apr, 2026

Deployment strategies in Kubernetes help update applications safely while minimizing downtime and reducing risk.
By using deployment strategies, teams can ensure smooth updates, reduce production errors, and improve overall application reliability.

Deployment Strategies In Kubernetes

There are different approaches through which we can manage our containerized applications. These different deployment strategies allow us to roll out the updates to the applications with minimal downtime. The following are the some of the popularly known kubernetes Deployment Strategies:

  1. Recreate Deployment Strategy
  2. Rolling Update Deployment Strategy
  3. Blue Green Deployment Strategy
  4. Canary Deployment Strategy
  5. A/B Testing Deployment Strategy
  6. Shadow Deployment Strategy

Recreate Deployment Strategy

Recreate Deployment Strategy

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
strategy:
type: Recreate
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:latest

Rolling Update Deployment Strategy

Rolling-Update Deployment Strategy

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:latest

Blue-Green Deployment Strategy

Blue-Green

apiVersion: v1
kind: Service
metadata:
name: my-app-service
labels:
app: my-app
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: my-app

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-blue
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
color: blue
spec:
containers:
- name: my-app-container
image: my-image:blue

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-green
spec:
replicas: 0
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
color: green
spec:
containers:
- name: my-app-container
image: my-image:green

Canary Deployment Strategy

Canary-Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:latest

apiVersion: v1
kind: Service
metadata:
name: my-app-service
spec:
ports:

A/B Testing Deployment Strategy

A_B-Testing

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:version-a

apiVersion: v1
kind: Service
metadata:
name: my-app-service
spec:
ports:

Shadow Deployment Strategy

Shadow-Deployment

apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-shadow
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:latest

apiVersion: v1
kind: Service
metadata:
name: my-app-shadow-service
spec:
ports: