Search code examples
kubernetes

How to control speed of RollingUpdate


I have a deployment configured in yml using RollingUpdate:

  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 10%

I'd like to be able to slow down the deployment to give a longer window in which I can pause and possibly rollback.

Is there a way to configure this?


Solution

  • Kubernetes doesn't really have a way of controlling this (the speed of the rolling updates). maxUnavailable: 0, maxSurge: 10% seems like a step gap hack.

    If you are concerned about your update being ready and having the ability to rollback, you should consider creating a canary Deployment. In other words, another Deployment with a small number of replicas, that you can delete if something goes wrong.

    Another alternative is looking at a Service-Mesh like Istio that allows you to do Canary Deployments.