Monthly musings with Marcin Wyszynski, technical co-founder of Spacelift

📨 Join the Newsletter

Kubernetes

8 Different Types of Kubernetes Deployment Strategies

Kubernetes Deployment Strategies

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.

Kubernetes offers two built-in Deployment strategies (Recreate and RollingUpdate). On top of these, platform and SRE teams commonly implement advanced deployment patterns such as Blue/Green, Canary, Shadow, and A/B testing using service meshes, gateways, and progressive delivery controllers.

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

All of these strategies work best when they’re expressed as code and rolled out consistently across environments. That’s exactly what a GitOps workflow with Spacelift gives you: Kubernetes manifests (or Helm/Kustomize configs) live in Git, and Spacelift keeps your clusters in sync with what’s in the repo using Kubernetes Stacks and policy-driven automation.

If you want to learn more about Spacelift, create a free account today or book a demo with one of our engineers.

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"

Read more: Blue/Green Deployments With Terraform & Kubernetes

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

Frequently asked questions

  • What is the safest Kubernetes deployment strategy?

    The safest Kubernetes deployment strategy is Blue-Green Deployment, as it minimizes downtime and risk during application updates.

  • How do I do zero-downtime deployments in Kubernetes?

    To achieve zero-downtime deployments in Kubernetes, use rolling updates with properly configured readiness and liveness probes.

  • What’s the difference between Canary and A/B testing?

    Canary testing validates system stability during deployment, while A/B testing evaluates feature effectiveness post-deployment. Both can run in production, but with different goals and methodologies.

  • When should I use Blue/Green vs RollingUpdate?

    Use Blue/Green deployments when you need zero downtime with fast rollback and can afford to run two full environments. Use RollingUpdate when resource constraints or gradual release are priorities.

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