CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Application Developer

Blue-Green Deployments with Service Selectors

Blue-green needs no special tooling in Kubernetes. Run both versions as separate Deployments, point one Service at whichever should receive traffic, and cut over by patching the Service's selector. The switch is instant and complete, the rollback is the same command backwards, and the old version is still running the whole time.

Application Deployment Guide 17 of 44 Intermediate

A Service selector is plain equality on Pod labels, re-evaluated continuously by the endpoints controller. Patching it does not restart anything and does not touch either Deployment - the EndpointSlice is simply recomputed, typically within a second.

Four application Pods and a client Pod, spread across the workers. The cutover is a control-plane operation and does not depend on placement.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when a release has to switch over instantly and roll back just as fast. This matters because blue-green needs no special tooling in Kubernetes - a Service selector is plain label equality, re-evaluated continuously, so one patch moves all of the traffic.

Before you start

  1. Two versions running at once

  2. The Service only sees one of them

  3. Flip it

  4. And back

Official sources