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. Organisations also pay for the staff overhead to maintain and monitor both environments.

Another hurdle for organisations 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.

Resources and Events
RESORTS WORLD LAS VEGAS | JUNE 18 - 21
Pure//Accelerate® 2024

Join us June 18-21 and level up your data success.

Register Now
PURE //
Blogs
BLOG ARTICLE
Optimise GenAI Apps with Retrieval-augmented Generation
7 min. read

Learn how Pure Storage is working with NVIDIA to help enterprises optimise their AI efforts.

Read the Blog
PURE //
Resources
RESOURCE
10 Ways Pure Helps You Uncomplicate Storage, Forever
PDF

Discover 10 ways Pure Storage® can help you uncomplicate storage, forever.

Read More
PODCAST
Reality Check On Storage as a Service and Evergreen//One
33 Min

Learn about Pure's Evergreen//One subscription offering and the white glove support we provide Evergreen//One customers.

Listen Now
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.