Kubernetes Deployment Playbook

One web app. Six strategies. Real-world settings.

A cloud-native project that demonstrates six mainstream Kubernetes deployment strategies on a single AKS cluster.

View on GitHub

Business Challenge & Solution

Deployment is a critical process: it makes an application available in a live environment and delivers business value.

How does a team select the right deployment method for a given requirement?

This project:

  • creates and deploys a simple web application in a real-world environment (Cluster + TLS + DNS)
  • compares six common deployment methods
  • concludes with a deployment decision strategy

Architecture

Infrastructure architecture

Infrastructure Architecture

Kubernetes architecture

Kubernetes Components

Rolling Update

Incrementally replaces old pods with new ones via maxSurge and maxUnavailable, keeping the service available throughout the rollout.

Pros:

  • Zero downtime when readiness probes are configured correctly.
  • Native to Kubernetes — no additional controllers required.
  • Resource-efficient: no duplicate environment required.

Cons:

  • Old and new versions coexist during rollout, so the app must be backward-compatible.
  • Rollback is another rolling update, not an instant switch.

Common use cases:

  • Default choice for stateless services requiring continuous availability.
  • Routine, low-risk version upgrades in production.
Rolling update in Argo CD

Gradually replaces older versions of an application with new ones.

Rolling update curl output

Zero downtime from V1.0.0 to V1.1.0.

Recreate

Terminates all existing pods before starting the new version, producing a brief service outage during the switch.

Pros:

  • Simplest possible rollout — no version overlap to reason about.
  • Guarantees a clean cutover for workloads that cannot tolerate concurrent versions.
  • No extra compute overhead during the transition.

Cons:

  • Incurs downtime between old-pod shutdown and new-pod readiness.
  • Unsuitable for user-facing services with availability SLAs.

Common use cases:

  • Batch jobs, internal tools, or dev environments where downtime is acceptable.
  • Applications with breaking schema or protocol changes that forbid version overlap.
Recreate in Argo CD

Terminates all existing pods before starting the new version.

Recreate curl output

Experiences downtime from V2.0.0 to V2.1.0: "no healthy upstream".

Canary

Progressively shifts a small percentage of live traffic to the new version, increasing the weight in stages while monitoring health before full promotion.

Pros:

  • Limits blast radius by exposing only a subset of users to the new version.
  • Enables data-driven promotion via automated analysis of real production metrics.
  • Fast rollback by shifting traffic weight back to the stable version.

Cons:

  • Requires reliable metrics and analysis rules; otherwise promotion becomes manual.
  • Both versions must coexist safely, including shared state and downstream contracts.

Common use cases:

  • High-risk releases where gradual, monitored exposure is required.
  • Services with strong observability and automated rollback criteria.
Canary in Argo Rollouts

Rollout controlled by setting weight.

Canary traffic split in Kiali

Traffic splits from 25% to 50% to 100%.

Blue-Green

Runs two identical environments — blue (current) and green (new) — and cuts all traffic over at once after the green environment passes validation.

Pros:

  • Instant cutover and equally instant rollback by flipping the router back to blue.
  • The new version can be fully validated on the preview lane before any user sees it.
  • No version mixing at the traffic layer — cleaner for stateful or contract-sensitive services.

Cons:

  • Roughly doubles compute cost during the overlap window.
  • Database and schema changes still need to be backward-compatible across both lanes.
Blue-Green in Argo Rollouts

Manual promotion, traffic flip, old version auto-removed.

Blue-Green preview lane

Header-based request gets the preview version; active request gets the stable version.

Blue-Green traffic flip

The moment traffic flips, from V4.0.0 to V4.1.0.

A/B Testing

Routes specific user segments to different versions based on request attributes (headers, cookies, geography) rather than random weights, so behavior can be compared under matched conditions.

Use cases:

  • Feature experimentation: measure conversion or engagement between variants.
  • Targeted rollout to beta users, internal testers, or a specific region.
  • Comparing UX or algorithm changes with statistically meaningful cohorts.
A/B Testing in Argo Rollouts

Canary rollout ensures progressive deployment; Istio splits traffic 50/50 for A/B testing.

A/B Testing preview

Header-based request hits the preview version; stable traffic hits both versions randomly.

Shadow Deployment

Mirrors a copy of live production traffic to the new version while responses are discarded, so the candidate is exercised with real workload without affecting users.

Use cases:

  • Performance and load testing under real production traffic patterns.
  • Validating a rewritten or refactored service against the incumbent for behavioral parity.
  • Safely exercising risky changes (new database driver, dependency upgrade) with zero user impact.
Shadow in Argo Rollouts

Rollout of 2 pods to handle mirrored traffic.

Shadow log output

Stable traffic shows stable version V6.0.0; canary pod log confirms traffic gets mirrored.

Shadow traffic in Kiali

Stable:canary ~= 50/50 confirms traffic is being mirrored.

Strategies Decision

Use decision tree to choose the right deployment strategy for release.

Deployment strategy decision tree

Deployment strategy decision tree.