Skip to Content

What is a Blue-green Deployment on Kubernetes?

Kubernetes supports a software development lifecycle strategy called blue-green deployments, which involves running both the new and old versions of an application simultaneously in production. Read on to learn what a blue-green deployment is and why you might want to implement this tactic for your Kubernetes applications. 

What Is a Blue-green Deployment?

A blue-green deployment is a software development lifecycle strategy that involves running both the new and previous versions of an application simultaneously in production. Users are gradually migrated from the older version (blue) to the newer version (green) of the application after deployment. 

For fast delivery of software updates, developers needed a way to continually deploy features. Traditionally, code deployments required downtime, so they were done on specific days either weekly or monthly. This strategy slows down updates to software and doesn’t support continuous delivery.

Blue-green deployments solve this problem by running both the old and new versions of an application in production. The blue version is the old application, and the green version is the new one. Users are slowly moved over to the new green version after it has been deployed. After users are moved to the new green version, the blue version can act as a failover if code must be rolled back to the previous version due to bugs or critical errors.

Blue-green vs. Rolling Deployment with Kubernetes

In many enterprise environments, production runs on multiple servers. Instead of having multiple versions running simultaneously, a rolling deployment works with one version of an application and updates each server individually. 

Suppose that you have two servers behind a load balancer and running a single production application. In a rolling deployment, a developer takes one server out of rotation, updates the application, and then puts the server back into rotation. The second server is taken out of rotation and then updated as well. Most rolling environments have three servers so that a single server can act as a failover in case there are errors in the new version environment.

Blue-green vs. Canary with Kubernetes

Canary deployments are similar to blue-green deployments, but canary deployments send specific users to the newer version of an application rather than slowly moving all users over to the new version. It’s a great strategy for testing a new application with users interested in beta testing or silently testing new features with new users for feedback.

Usually, canary deployments are used on a small subset of users and the original version still runs for a majority of users. Because only a small subset of users are directed to the new version, the infrastructure is less costly and does not need to be too advanced to support a small number of users.

Advantages of a Blue-green Deployment

In any continuous delivery environment, blue-green deployments offer several benefits. Blue-green deployments speed up delivery of application feature updates. Developers no longer need to wait for a window to deploy new code, which can delay deployments for potentially months.

Of the three deployment types, blue-green deployments are safer than the others. Both versions of the application run simultaneously, so developers can roll back changes without much effort. Users won’t experience downtime or lose productivity during deployments or rollbacks if they’re necessary.

Disadvantages of Blue-green Deployment

The biggest disadvantage of blue-green deployments is the expense. Companies must have the IT budget to pay for dual environments that can host both the blue and the green versions of an application. Organizations also pay for the staff overhead to maintain and monitor both environments.

Another hurdle for organizations is synchronization of databases. Database changes aren’t as easily rolled back, so updates to tables and database schema must be done carefully, especially if both green and blue environments use the same database. Both environments must be carefully tested before being deployed to production databases.

When to Use a Blue-green Deployment with Kubernetes

Continuous delivery and Kubernetes go hand in hand. Developers can automatically deploy applications using orchestration tools like Kubernetes. Kubernetes can be used to orchestrate both the blue and the green environments, and developers can simply deploy code and let Kubernetes manage promoting code from a staging environment to production.

Containerized environments are perfect for blue-green deployments for their ability to quickly destroy and rebuild application pods so that they can run either blue or green versions. If a container application causes errors, developers can more easily roll back changes to the blue version.

09/2024
Portworx on Red Hat OpenShift Bare Metal
A validated architecture and design model to deploy Portworx® on Red Hat OpenShift running on bare metal hosts.
Reference Architecture
57 pages

Browse key resources and events

THOUGHT LEADERSHIP
The Innovation Race

The latest insights and perspectives from industry leaders at the forefront of storage innovation.

Learn More
PURE//ACCELERATE ROADSHOWS
Join the Next Era of Data at a Pure//Accelerate Roadshow

Discover the storage solutions and strategies to power the next generation and beyond.

Register Now
ANALYST REPORT
The CISO Blueprint for Success

CISOs get candid about the biggest InfoSec challenges they’re facing and the solutions to overcome them.

Read the Report
RESOURCE
Stop Buying Storage, Embrace Platforms Instead

Explore the needs, components, and selection process for enterprise storage platforms.

Read the Report
CONTACT US
Meet with an Expert

Let’s talk. Book a 1:1 meeting with one of our experts to discuss your specific needs.

Questions, Comments?

Have a question or comment about Pure products or certifications?  We’re here to help.

Schedule a Demo

Schedule a live demo and see for yourself how Pure can help transform your data into powerful outcomes. 

Call Sales: 800-976-6494

Mediapr@purestorage.com

 

Pure Storage, Inc.

2555 Augustine Dr.

Santa Clara, CA 95054

800-379-7873 (general info)

info@purestorage.com

CLOSE
Your Browser Is No Longer Supported!

Older browsers often represent security risks. In order to deliver the best possible experience when using our site, please update to any of these latest browsers.