带 readynessprobe 的 helm 部署
helm deployments with readynessprobe
我在我的 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.
我在我的 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.