minReadySeconds如何影响就绪探针? [英] How does minReadySeconds affect readiness probe?
问题描述
假设我有一个这样的部署模板
Let's say I have a deployment template like this
spec:
minReadySeconds: 15
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 20
successThreshold: 1
timeoutSeconds: 5
这将如何影响我的应用程序的新版本? minReadySeconds
和 initialDelaySeconds
是否会同时计数? initialDelaySeconds
会先出现,然后是 minReadySeconds
吗?
How will this affect the newly versions of my app? Will the minReadySeconds
and initialDelaySeconds
count at the same time? Will the initialDelaySeconds
come first then minReadySeconds
?
推荐答案
来自Kubernetes 部署文档:
From Kubernetes Deployment documentation:
.spec.minReadySeconds
是一个可选字段,用于指定新创建的Pod可以准备就绪而不会使其任何容器崩溃的最小秒数,以便将其视为可用.默认为0(准备就绪后,Pod将被视为可用).要了解有关何时将Pod准备就绪的更多信息,请参见容器探针
.spec.minReadySeconds
is an optional field that specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing, for it to be considered available. This defaults to 0 (the Pod will be considered available as soon as it is ready). To learn more about when a Pod is considered ready, see Container Probes
因此,新创建的应用程序pod必须准备好 .spec.minReadySeconds
秒,才能被视为可用.
So your newly created app pod have to be ready for .spec.minReadySeconds
seconds to be considered as available.
initialDelaySeconds
:启动容器后,启动活动性或就绪性探测之前的秒数.
initialDelaySeconds
: Number of seconds after the container has started before liveness or readiness probes are initiated.
因此, initialDelaySeconds
在 minReadySeconds
之前.
可以说,吊舱中的容器已在 t
秒开始.准备就绪探测将在 t + initialDelaySeconds
秒启动.假设Pod在 t1
秒( t1> t + initialDelaySeconds
)准备就绪.因此,此pod将在 t1 + minReadySeconds
秒后可用.
Lets say, container in the pod has started at t
seconds. Readiness probe will be initiated at t+initialDelaySeconds
seconds. Assume Pod become ready at t1
seconds(t1 > t+initialDelaySeconds
). So this pod will be available after t1+minReadySeconds
seconds.
这篇关于minReadySeconds如何影响就绪探针?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!