Skip to main content
XenonStack

Kubernetes

XenonStack Blog Blue Green Deployment Strategy in Kubernetes

| Published | Updated

Blue Green Deployment Strategy in Kubernetes
13:58

Key takeaway

  • Blue green deployment strategy in Kubernetes: how Argo Rollouts, Flagger and Gateway API traffic splitting switch releases safely, plus costs and rollback.

A blue green deployment strategy runs two identical production environments: blue serves live traffic while green runs the new release. Once green passes its tests, traffic is switched to it in one step, and blue stays ready so the team can switch back in seconds if something goes wrong.

In Kubernetes, blue green is not a built-in Deployment option. The native Deployment object supports only rolling updates and recreate, so platform teams implement blue green by switching a Service selector, by using controllers such as Argo Rollouts or Flagger, or by moving route weights with Gateway API. This guide compares those options, explains what changed recently, and sets out when blue green is worth its extra cost.

What is a blue green deployment strategy?

The blue environment runs the current version and handles all user traffic. The green environment runs the new version with the same configuration, capacity and dependencies, and is tested away from users. When green is ready, the router or Service in front of both is changed so that all requests go to green. Blue is kept running for a period so that rollback is a routing change rather than a redeployment.

The appeal for enterprise teams is predictable releases: users see either the old or the new version, never a mix, and rollback is fast. The price is running two full environments during each release. For the wider set of Kubernetes release tooling, see our guide to Kubernetes deployment tools and best practices.

How does blue green deployment work in Kubernetes?

The core Kubernetes building blocks are Deployments, which run versioned sets of pods, and Services, which route traffic to pods that match a label selector. A basic blue green release follows three stages: deploy the new version as a separate Deployment, test it, then change the Service selector so live traffic reaches it.

light-bulb

Deploy to the Green Environment

The new version of the application is released in Green environment Successfully. At some point, even the current version can be deployed on the network as well if a rollback is needed sooner in the future.

light-bulb

Testing in Green Environment

After deploying the application the Green environment is also tested before going live. This makes sure the newly deployed real version will run with no defects or poor performance as can be seen below.

The Kubernetes Deployment documentation lists only two strategy types, Recreate and RollingUpdate, with RollingUpdate as the default and both maxSurge and maxUnavailable defaulting to 25%. A rolling update mixes old and new pods during the rollout, which is why teams that need an all-at-once switch add a controller or routing layer on top.

Which Kubernetes-native options support blue green today?

OptionHow the switch happensWhen it fitsCurrent status (November 2026)
Service selector switchTwo Deployments with version labels; the Service selector is changed from blue to greenSmall teams, few services, manual or scripted releasesCore Kubernetes; no extra components
Argo Rollouts BlueGreenA Rollout resource points an active Service and an optional preview Service at ReplicaSets and switches the active Service on promotionTeams using Argo CD or wanting analysis gates and manual promotionDocumented BlueGreen strategy; traffic router plugins, including a Gateway API plugin, are an alpha feature since 1.5.0
Flagger Blue/GreenFlagger runs tests and metric checks for a set number of iterations, then switches live traffic on promotionFlux users and teams that want automated promotion and rollbackSupported with the Kubernetes CNI, Istio, Linkerd, App Mesh, NGINX, Contour, Gloo Edge and Gateway API
Gateway API HTTPRoute weightsbackendRefs weights move traffic from blue to green, all at once or in stepsTeams standardising on Gateway API for ingressHTTPRoute has been GA (v1) since Gateway API v1.0
Ingress-based switchThe Ingress backend is changed from the blue to the green ServiceExisting estates still on IngressIngress NGINX is retired; use another supported controller or migrate to Gateway API

Argo Rollouts

Argo Rollouts is "a Kubernetes controller and set of CRDs which provide advanced deployment capabilities", including blue green and canary. In its BlueGreen strategy, the activeService carries production traffic and the previewService lets teams test the new ReplicaSet first. Key settings from the documentation:

Two-column diagram of Kubernetes blue green options: Service selector switch for few services, Argo Rollouts for Argo CD users, Flagger for Flux users, Gateway API weights for Gateway API estates.
  • autoPromotionEnabled defaults to true; set it to false to pause until someone promotes the rollout.
  • prePromotionAnalysis must succeed before the switch, otherwise the rollout aborts; postPromotionAnalysis runs after the switch and returns traffic to the stable ReplicaSet if it fails.
  • scaleDownDelaySeconds defaults to 30, the time the old ReplicaSet stays up after the switch.
  • previewReplicaCount lets the preview run with fewer replicas to save resources; if omitted, it scales to 100% of replicas.

Flagger

Flagger is a progressive delivery Kubernetes operator in the Flux family. For blue green, it replaces traffic weights with a number of iterations: it runs conformance and load tests, checks metrics every interval, and switches live traffic when the release is promoted. According to its documentation, "For Blue/Green deployments no service mesh or ingress controller is required." Blue/Green with traffic mirroring is available with Istio and Gateway API, and should be used only for idempotent requests because each request is sent to both versions.

Gateway API traffic splitting

With Gateway API traffic splitting, an HTTPRoute lists blue and green Services as backendRefs with weights. Weights are proportional, so 90 and 10 send about 90% and 10% of traffic, and setting blue to 0 completes the cut-over. A header-matched rule can send test traffic to green before any users reach it, and if green shows errors "the weights can be updated to quickly shift traffic back".

What has changed for blue green on Kubernetes?

  • Ingress NGINX retirement: the Kubernetes project announced that best-effort maintenance would end in March 2026, after which there are no releases, bug fixes or security updates. It recommends Gateway API as the modern replacement for Ingress.
  • Gateway API maturity: Gateway, GatewayClass and HTTPRoute reached GA in the v1.0 release, so weighted routing no longer depends on controller-specific annotations.
  • Controller support for Gateway API: Flagger lists Gateway API for blue green, mirroring and session affinity, and Argo Rollouts offers a Gateway API traffic router plugin.

Blue green, canary or rolling update: which should you choose?

StrategyHow traffic movesBest forTrade-off
Rolling updatePods are replaced gradually; old and new run togetherStateless services with backward-compatible changesMixed versions during rollout; rollback is another rollout
Blue greenAll traffic switches at once after testingReleases where users must see one version and rollback must be instantDouble capacity during the release
CanaryA small share of real traffic first, then larger stepsHigh-traffic services where metrics can judge a releaseNeeds a traffic manager and good metrics; slower to complete
A/B testingUsers routed by header or cookieProduct experiments comparing versionsNot a safety mechanism on its own

Many teams combine methods: blue green for the switch, with a short canary or mirrored phase before it. Our guide to A/B testing covers the experimentation side.

What are the cost, data and governance considerations?

  • Capacity cost: blue green runs two environments during each release. Reduce it with a smaller preview, such as previewReplicaCount in Argo Rollouts, and by scaling blue down once the rollback window closes.
  • Databases and state: both versions usually share data stores, so schema changes must work with old and new code until blue is retired. Separate migrations from releases where possible.
  • Sessions and long-lived connections: plan how in-flight sessions, queues and WebSocket connections are drained when traffic switches.
  • Release governance: record who promoted each release, what analysis passed and why. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, which matters when agents start recommending or approving promotions.

Monitoring decides whether a switch was safe. Use the same service-level indicators for pre-promotion and post-promotion analysis, and alert on error rates and latency rather than pod status alone. AgentSRE uses a fleet of AI agents to automate detection, root cause analysis and remediation for teams that cannot afford downtime.

How should a platform team adopt blue green deployment?

  1. Choose candidate services: start with customer-facing, stateless services where a mixed-version rollout is a real risk.
  2. Standardise routing: decide on Service selector switching, Gateway API or a mesh, and move off retired ingress controllers.
  3. Pick a controller: Argo Rollouts or Flagger, matched to your GitOps tooling.
  4. Define analysis gates: agree the metrics and thresholds that block or reverse a promotion.
  5. Automate in the pipeline: wire deployment, tests and promotion into your continuous delivery pipeline, with manual promotion for high-risk releases.
  6. Rehearse rollback: practise switching back to blue, including data compatibility, before relying on it.

When is blue green the wrong choice?

Blue green is a poor fit when capacity is tight and doubling a large service is too expensive, when schema changes cannot be made backward compatible, or when a release needs real-user metrics to judge it, which canary handles better. For small internal services, a rolling update with readiness probes is often enough.

To map one release decision your agents should make, such as when to promote or roll back, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions about blue green deployment

What is a blue green deployment strategy?

It is a release method that runs two production-ready environments. Blue serves live users, green runs the new version, and traffic is switched to green once it passes tests. Blue stays available so you can switch back quickly if problems appear.

Does Kubernetes support blue green deployment natively?

Not as a Deployment strategy. A Kubernetes Deployment supports only RollingUpdate, the default, and Recreate. Blue green is built by switching a Service selector or by using a controller such as Argo Rollouts or Flagger, or weighted routes in Gateway API.

What is the difference between blue green and canary deployment?

Blue green moves all traffic to the new version in one switch after testing, with the old version kept ready for rollback. Canary shifts a small share of real traffic first and increases it in steps while metrics are checked.

Which tool should I use for blue green in Kubernetes?

Argo Rollouts suits teams that want a Rollout resource with active and preview Services and analysis gates. Flagger suits Flux users and works with the Kubernetes CNI, service meshes and Gateway API. Gateway API weights suit teams that manage routing directly.

Is Ingress NGINX still a safe way to switch traffic?

The Kubernetes project retired Ingress NGINX: best-effort maintenance ran until March 2026, and there are no further releases or security fixes after that. Plan a move to Gateway API or another supported controller.

How long does Argo Rollouts keep the old version after a switch?

By default the old ReplicaSet is scaled down 30 seconds after the switch, set by scaleDownDelaySeconds. Increase it if you need a longer window for instant rollback.

Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in solving your challenges with the XenonStack team?
Get Started

Tell us about you and your priorities so we can prepare the right conversation. It takes about 2 minutes.

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Continue