Skip to Content
Kubernetes & Container 7 min. read

Setting up Blue-Green Deployments without Downtime

Setting up Blue-Green Deployments: This is how teams deliver releases without downtime, test in a realistic manner, and roll back to production immediately in case of errors.

devRocks Engineering · 21. September 2026
Kubernetes Terraform CI/CD Helm Infrastructure as Code
Setting up Blue-Green Deployments without Downtime AI-generated

A critical release is ready, but a bug in the checkout, customer portal, or an internal API must not interrupt operations. Those who want to set up Blue-Green deployments separate exactly this risk from the actual go-live: Two technically equivalent production environments allow for a new version to be prepared under realistic conditions, and the traffic is only switched over when it has been proven to work.

This approach can make releases significantly more predictable. However, it does not replace a clean architecture, automated tests, or a robust operational model. Especially for stateful applications, the implementation in detail determines whether Blue-Green actually reduces downtimes or simply creates two costly environments with new error patterns.

What Blue-Green Deployments Achieve in Operation

In a Blue-Green deployment, two versions of the same production platform exist in parallel. Blue refers to the currently active environment. Green contains the new release version, is generated from the same infrastructure definition, and initially receives no or only selectively controlled production traffic. After deployment, testing, and approval, a load balancer, ingress controller, or API gateway routes requests to Green.

The crucial advantage lies in rollback. If the new version shows increased error rates, longer response times, or business-related issues after the switch, traffic can be quickly routed back to Blue. This is different from a classic rollback via new deployment: there, artifacts have to be redeployed, containers started, and dependencies checked. With Blue-Green, the previous version is already operational.

For medium-sized companies, this is particularly relevant where maintenance windows are expensive: in e-commerce systems, customer portals, SaaS applications, B2B platforms, or APIs connected with logistics, ERP, and partners. Shorter release downtimes are a visible benefit. At least as valuable is the reduced operational uncertainty for teams that no longer want to perform risky manual interventions outside of core working hours.

Before Setting Up: Create the Right Starting Point

Blue and Green must be functionally comparable. This applies not only to container images or application code but also to network rules, secrets, configurations, autoscaling, monitoring, certificates, and permissions. If environments are maintained manually, differences can gradually arise. A release might appear clean in Green but fail under actual production traffic.

Infrastructure as Code is therefore not an optional addition. Whether Terraform, OpenTofu, Helm, Kubernetes manifests, or a cloud-native tool is used depends on the stack. What’s important is that both environments can be reproducibly created and validated from the same source. Configuration should be versioned, sensitive values placed into suitable secret management, and changes made through a traceable pipeline.

Capacity planning also deserves attention. During the switch phase, both environments may be running at production-like performance. For compute-intensive workloads, this can nearly double infrastructure costs temporarily. This is often justifiable if it avoids a multi-hour maintenance window or a business outage. For very large platforms, a combination of Blue-Green for critical components and other release strategies for less critical services may be more economical.

Databases are the Real Litmus Test

The most common fallacy is: switch the application, leave the database unchanged. This only works if schema and data accesses match both application versions. A destructive migration can render Blue non-functional immediately, even though Green has not been sufficiently validated yet. Then there may be an old environment, but no reliable fallback.

The principle of Expand and Contract has proven effective. Initially, the schema is compatibly extended, for example, through an additional column or table. The new application can utilize the new structure while the old one continues to operate. Only once Green is stable and Blue is no longer needed as a fallback option will old fields, indexes, or access paths be removed.

For larger data migrations, this is not always sufficient. Data may need to be transferred incrementally, double-written, or synchronized through asynchronous processes. This requires a business decision: Can a rollback result in lost or double-processed transactions? Must orders, payments, or status changes be idempotent? Anyone who waits to ask these questions until the release call has not properly set up Blue-Green.

Planen Sie ein ähnliches Projekt? Wir beraten Sie gerne.

Request consultation

Setting Up Blue-Green Deployments: The Practical Process

The process begins with an immutable build artifact. The CI pipeline creates a container image or package, assigns it a unique version, checks dependencies and known security vulnerabilities, and runs automated unit, integration, and possibly end-to-end tests. The same artifact will later be deployed in Green. A new build before production would break traceability.

The CD pipeline then provisions or updates Green with production-matching settings. Before switching the traffic, technical smoke tests should not only check for an HTTP status. It makes sense to verify key user paths, authentication, API connections, queue processing, caching, and critical external interfaces. What tests are mandatory depends on the business process. For a shop, the shopping cart is more relevant than a rarely used administration view.

Next comes the controlled activation. In Kubernetes, an ingress, service mesh, or gateway can direct traffic to the Green workloads. In other platforms, a load balancer, reverse proxy, or DNS-based control takes on this task. DNS alone is often unsuitable for critical switches because caches and TTLs can delay behavior. A centralized traffic manager with immediate switching capability is generally better controllable.

The switch should not only be viewed as a single button press. Define abort criteria in advance: for example, an increasing 5xx rate, a latence threshold being exceeded, unusually many login errors, or deviations in business metrics. An automated or clearly responsible rollback must take these signals into account. It’s also important to let Blue continue running initially after the switch. Only after a defined observation period should the old environment be dismantled or prepared for the next release.

Observability Determines Safe Releases

A green deployment status only indicates that pods, instances, or processes are started. It does not answer whether customers can successfully complete their tasks. Therefore, every Blue-Green strategy needs metrics, logs, and traces that clearly differentiate both environments.

Technical telemetry includes error rates, response times, utilization, database connections, queue lengths, and resource consumption. Business signals are equally important: completed purchases, successful document uploads, processed orders, or the ratio of valid API responses. If, after the switch, the technical latency remains stable but no more orders are being completed, the alarm must still trigger.

Dashboards and alerts should not only exist for the release night. They are part of ongoing operations. Teams need clear responsibilities, escalation paths, and a runbook: Who decides on rollback or continued operation? Which metric is considered critical? How will customers or business units be informed if a switch is reversed? Binding answers significantly shorten reaction times.

Typical Limits and When Another Strategy Fits Better

Blue-Green is not the best choice for every application. For very large databases, long batch processes, or systems with many persistent connections, parallel provisioning can be cumbersome. WebSockets, file uploads, and background jobs must also be designed to ensure that no states are lost or double-processed during the switch.

Canary releases make sense when teams want to initially deploy a new version to a small share of real users and gradually observe their behavior. Rolling updates, on the other hand, reduce the additional resource demand but usually do not offer such an immediate rollback to a fully warm-running old version. In practice, a hybrid approach is often correct: Blue-Green for business-critical frontends and APIs, Canary for risky functional changes, and Rolling Updates for internal, stateless services.

Security also needs to be integrated into the process. New images need a verifiable origin, permissions should be granted according to the least-privilege principle, and secrets must not be uncontrolled copied between environments. Anyone who organizes CI/CD, Kubernetes operation, observability, and infrastructure separately needs to define these handovers particularly clearly. An end-to-end accountable operational approach reduces these friction losses.

Blue-Green deployments unleash their value not through two colors in the cluster but through a robust delivery chain from build to monitored operation. Therefore, start with a clearly defined, business-critical service, measure release duration and error rates before and after the switch, and only expand the pattern once rollback, data migration, and responsibilities function correctly in real cases.

Questions About This Topic?

We are happy to advise you on the technologies and solutions described in this article.

Get in Touch

Seit über 25 Jahren realisieren wir Engineering-Projekte für Mittelstand und Enterprise.

Weitere Artikel aus „Kubernetes & Container“

Frequently Asked Questions

Blue-Green Deployments offer the advantage of deploying a new version of an application in parallel with the current version, which minimizes downtime during the release. Additionally, it allows for quick rollback since the old version is already operational, enabling fast traffic switching in case of issues.
Databases need to be handled carefully, as changes to database schemas between the two application versions must be compatible. The 'Expand and Contract' principle is recommended to ensure that the new version can utilize the existing structure while the old version continues to function.
Before switching the traffic, technical smoke tests are crucial to ensure that core functionalities such as user login or API connections work properly. A thorough testing phase helps to identify issues early and ensure the stability of the new version.
During the switch phase, both environments may run close to production, which can increase infrastructure costs. Careful capacity planning is essential to ensure that the required resources are available without leading to unexpected cost increases.
Blue-Green Deployments are not suitable for all scenarios, especially with large databases or long batch processes. In these cases, alternatives like Canary Releases or Rolling Updates may be more appropriate to avoid additional resource strain or to enable a gradual rollout.

Didn't find an answer?

Get in touch