Kubernetes - Rolling update killing off old pod without bringing up new one

后端 未结 3 2106
醉酒成梦
醉酒成梦 2021-02-20 09:39

I am currently using Deployments to manage my pods in my K8S cluster.

Some of my deployments require 2 pods/replicas, some require 3 pods/replicas and some of them requi

3条回答
  •  逝去的感伤
    2021-02-20 10:14

    As answered already, you can set the maxUnavailable to 0 to achieve the desired result. A couple of extra notes:

    1. You should not expect this to work when using a stateful service that mounts a single specific volume that is to be used by the new pod. The volume will be attached to the soon-to-be-replaced pod, so won't be able to attach to the new pod.

    2. The documentation notes that you cannot set this to 0 if you have set .spec.strategy.rollingUpdate.maxSurge to 0.

    https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-unavailable

提交回复
热议问题