how gray release or gated launch while on kubernbetes?

3/21/2017

Does the k8s support gated launch or called gray release ? for example, I deploy a nginx service in k8s which version is 1.10.2 with replica = 10, then I want to upgrade the service to 1.11.5, I modify the deployment and the I use the kubectl rollout status deployment nginx, I find all of the 10 pods has been set to 1.11.5,so how can I reach the status --- 2 pods with verion is 1.11.5 and 8 pods remain old 1.10.2?

-- J.Woo
kubernetes

1 Answer

3/21/2017

This pattern is referred to as canary deployments in the documentation. (See the page linked)

In short:

  • add a differentiating label say track: stable to your pods in the deployment (do this once and roll it out)
  • make a copy of the deployment file, name it foo-canary (make sure you do change the name in the file)
  • change that label to track: canary
  • change to replicas: 2
  • change the image or whatever else you need to and deploy it
  • when satisfied with the result change the original deployment and roll it out
-- Janos Lenart
Source: StackOverflow