[Demo Webinar] ⛏️ How to build a user-friendly infra self-service portal with Spacelift

➡️ Register Now

Kubernetes

8 Different Types of Kubernetes Deployment Strategies

Kubernetes Deployment Strategies

🚀 Level Up Your Infrastructure Skills

You focus on building. We’ll keep you updated. Get curated infrastructure insights that help you make smarter decisions.

In this post, we will delve into Kubernetes (K8s) deployment concepts and some common strategies, looking at the advantages and disadvantages of each. A suitable deployment strategy enables you to minimize downtime, enhance your customer experience, and increase reliability when releasing your application.

What is a Kubernetes Deployment Strategy?

Deployment strategies control the behavior of Pod replacement when a new version of an application is released to ensure availability and minimal disruption. Kubernetes offers eight built-in strategies to manage how and when old Pods are replaced with new ones during updates. Each strategy addresses different business needs: high availability, risk mitigation, or testing. For example, RollingUpdate is ideal for production services requiring continuous uptime.

Types of Kubernetes Deployment Strategies

  • Recreate: Shuts down all existing Pods before starting new ones. Simple but causes downtime
  • Rolling Update (default): Gradually replaces old Pods with new ones, minimizing downtime
  • Blue/Green: Deploys a new version (green) alongside the current (blue), then switches traffic once stable
  • Canary: Sends a small percentage of traffic to the new version, gradually increasing after validation
  • A/B Testing: Routes traffic to different versions based on specific user segments or rules
  • Ramped Slow Rollout: Slowly increases the number of Pods with the new version over time
  • Shadow Deployment: Clones live traffic to a new version for testing without affecting users
  • Best-Effort Controlled Rollout: Attempts gradual rollout with intelligent backoff or analysis. It is not natively built into Kubernetes, but can be orchestrated using tools like Argo Rollouts or Flagger with metrics-based decision-making.

The default deployment strategy in Kubernetes is RollingUpdate. For workloads requiring zero downtime and version control, RollingUpdate is the most suitable default approach. However, there are certain use cases when this may not be appropriate.

The table below summarizes the differences between the eight Kubernetes deployment strategies:

Deployment strategy Traffic shift model Downtime risk Rollback effort Typical K8s primitives / tools Ideal use cases Key caveats
Recreate Cut‑then‑start – old Pods killed, then new Pods created High (complete outage) Very easy (just redeploy old image) Deployment with strategy.type: Recreate Quick lab environments; state‑reset migrations Outage; fails health checks; hurts SLAs
Rolling update Gradual replace – new Pods added while old drain Low (configurable) Easy (roll back rev) Default Deployment (RollingUpdate, maxSurge, maxUnavailable) Standard production updates Can mask errors until high % shipped; slower overall
Ramped / Slow rollout Same as Rolling, but intentionally throttled & gated with pauses Very low Easy kubectl rollout pause/resume, Argo Rollouts “manual pause”, GitOps gates Mission‑critical apps where metrics must be checked between waves Ops overhead; requires release engineer on duty
Blue‑green All‑at‑once traffic switch between two identical fleets Zero (if switch passes readiness) Instant (DNS/service switch back) Two Deployments + two Services; swap selector or use Service label update / Ingress weight 0→1 Major version jumps, DB schema swaps, compliance constraints Doubles infra cost; stale “green” environment if not cleaned
Best‑effort  controlled rollout Rolling with aggressive maxSurge + maxUnavailable (e.g., 100%/100%) Moderate (brief blips possible) Easy Plain Deployment; surge/unavailable tuned for speed Large stateless fleets where speed > strict uptime May violate SLO if replicas drop below load peak
Shadow deployment Mirrored requests – new version gets copy of prod traffic, but responses aren’t served Zero (users never see shadow) None (nothing live) Service mesh (Istio TrafficMirroring), Envoy filters, Telepresence Perf/regression testing with prod‑like load; ML model validation Double compute cost; must scrub PII in mirrored payloads
Canary Progressive % traffic to new Pods (e.g., 1%→10%→25%→100%) Very low Very easy (shift weight back) Argo Rollouts, Flagger, Istio VirtualService weights Feature launches, config changes, error‑budget‑aware orgs Needs metrics & alerting to automate promotion/abort
A/B testing Traffic split by user/context attributes (headers, cookies, segments) Very low Moderate (need to retire user cohorts) Service mesh or API‑gateway routing rules; Feature‑flag platforms UX experiments, pricing/tests, ML model comparison Requires analytics pipeline; can leak state between variants

See how Spacelift can help you manage the complexities and compliance challenges of using Kubernetes with the newest Kubernetes integration. It brings with it a GitOps flow, so your Kubernetes Deployments are synced with your Kubernetes Stacks, and pull requests show you a preview of what they’re planning to change. It also has an extensive selection of policies, which lets you automate compliance checks and build complex multi-stack workflows.

1. Recreate Deployment

spec:
  replicas: 10
  strategy:
    type: Recreate

2. Rolling Update

  • Readiness probes monitor when the application becomes available. If the probes fail, no traffic will be sent to the pod. These are used when an app needs to perform certain initialization steps before it becomes ready. An application may also become overloaded with traffic and cause the probe to fail, preventing more traffic from being sent to it and allowing it to recover.
  • MaxSurge specifies the maximum number of pods the Deployment is allowed to create at one time.
  • MaxUnavailable specifies the maximum number of pods that are allowed to be unavailable during the rollout.
spec:
  replicas: 10
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 3
      maxUnavailable: 1

3. Ramped Slow Rollout

Ramped Slow Rollout means the new version is rolled out slowly, creating new replicas replacing the old ones. This is also another term for a Canary deployment that we discuss later in the article.

4. Blue/Green Deployment

kind: Service
metadata:
 name: web-app-01
 labels:
   app: web-app
selector:
   app: web-app
   version: v1.0.0

And the deployment for the blue web app:

kind: Deployment
metadata:
  name: web-app-01
spec:
  template:
        metadata:
           labels:
             app: web-app
             version: "v1.0.0"

When we want to direct traffic to the new (green) version of the app, we update the manifest to point to the new version, v2.0.0.

kind: Service
metadata:
 name: web-app-02
 labels:
   app: web-app
selector:
   app: web-app
   version: v2.0.0

The deployment for the green app:

kind: Deployment
metadata:
  name: web-app-02
spec:
  template:
        metadata:
           labels:
             app: web-app
             version: "v2.0.0"

5. Best-Effort Controlled Rollout

Blue / green deployments may also be referred to as ‘best-effort controlled rollouts’ — again, with the focus on updating your application or microservices with a focus on minimizing downtime and ensuring that the application remains available as much as possible during the deployment process.

6. Shadow Deployment

Canary or ‘Ramped slow rollout’ strategies are sometimes used interchangeably with the term ‘Shadow Deployment’.

A Shadow Deployment is a strategy where a new version of an application is deployed alongside the existing production version, primarily for monitoring and testing purposes. User traffic is not actively routed to the new version in a shadow deployment.

7. Canary Deployments

spec:
  replicas: 95

And the new application manifest:

spec:
  replicas: 5

In the example above, it might be impractical and costly to run 100 pods. A better way to achieve this is to use a load balancer such as NGINXHAProxy, or Traefik, or a service mesh like IstioHashicorps Consul, or Linkrd.

For painless and efficient maintenance of your K8s clusters, follow these 15 Kubernetes Best Practices.

8. A/B Testing

Key Points

The most Flexible CI/CD Automation Tool

Spacelift is an alternative to using homegrown solutions on top of a generic CI. It helps overcome common state management issues and adds several must-have capabilities s for infrastructure management.

Start free trial

Kubernetes Commands Cheat Sheet

Grab our ultimate cheat sheet PDF

for all the kubectl commands you need.

k8s book
Share your data and download the cheat sheet