我在 CI 中使用 helm 来使用较新版本的图表升级部署。
helm upgrade --wait --install .
预期行为: --wait 标志应该等待新图表中定义的 readinessProbe。 也可以看看: https://docs.helm.sh/helm/#helm-upgrade
但是,即使 readinessProbe 失败,它也不会等待并简单地部署新图表。
这会导致新图表失败并且旧图表被杀死。
与此无关 https://github.com/helm/helm/issues/3173 ,因为 readinessProbe 已正确执行但失败。但 Helm 根本不会等待这一点。
有人遇到过这样的问题吗? 谢谢!
最佳答案
通过在部署资源中设置以下 Kubernetes yaml 描述修复了该问题:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
Kubernetes Deployment Documentation:
Note: The Deployment controller will stop the bad rollout automatically, and will stop scaling up the new ReplicaSet. This depends on the rollingUpdate parameters (maxUnavailable specifically) that you have specified. Kubernetes by default sets the value to 1 and .spec.replicas to 1 so if you haven’t cared about setting those parameters, your Deployment can have 100% unavailability by default! This will be fixed in Kubernetes in a future version.
关于kubernetes - 使用 ReadynessProbe 进行 Helm 部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52384119/