If we want to do a blue–green style deployment for our component web of the pets application, then we can do so by using labels creatively. Let's first remind ourselves how blue–green deployments work. Here is a rough step-by-step instruction:
- Deploy a first version of the component web as blue. We will label the pods with a label color: blue to do so.
- Deploy the Kubernetes service for these pods with the label, color: blue in the selector section.
- Now we can deploy version 2 of the web component, but this time the pods have a label, color: green.
- We can test the green version of the service that it works as expected.
- Now we flip traffic from blue to green by updating the Kubernetes service for the web component. We ...