Home > OS >  How to ensure that at least 3 pods are always running even if there are any rolling updates in Kuber
How to ensure that at least 3 pods are always running even if there are any rolling updates in Kuber

Time:05-20

I have deployed an application in k8s cluster with 8 replicas. but how to ensure that there will be at least 3 pods always running during rolling update, can anyone please suggest a solution ?

Thanks in advance.

CodePudding user response:

you can set the required values on maxSurge and maxUnavailable

  strategy:
    rollingUpdate:
       maxSurge: 25%
       maxUnavailable: 50%
    type: RollingUpdate

setting maxUnavailable to 50% will make sure that you always have 4 pods running.

CodePudding user response:

You should be able to use the configuration option maxUnavailable: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-unavailable to guarantee that certain number of replicas are available during an update.

  • Related