Spinnaker blue/green deployment for Kubernetes

Spinnaker introduced traffic management in Kubernetes deployments in version 1.14. In this blog we discuss Blue/Green deployment strategy and how to configure in Spinnaker using traffic management.

Red/Black or Blue/Green Strategy :

Red/Black is to deploy a new version of your application alongside the existing version(s), send client traffic to the new version, and then disable traffic to existing version in the cluster.

With a red/black deployment, you keep the previous version available as a hot standby to enable painless rollbacks.

ConfiguringSpinnaker using traffic management :

For managing traffic to new server group and keep the current server group running without traffic the new deployment must support new server group deployment in parallel to existing server group. For this strategy, ReplicaSet kind must be used for deployments.

Traffic management strategy works by adding service selector to replicaSet server group deployed. The ReplicaSet label selectors in the manifest must be different from service selectors to allow the service selectors to be cleanly added and removed without affecting the replicaSet deployments.

Step 1: First, let’s assume we have already deployed a Service manifest with arbitrary selector labels from which we would like our workloads to receive traffic: