Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does minReadySeconds affect readiness probe?

Tags:

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 

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?

like image 311
Dean Christian Armada Avatar asked Nov 10 '18 12:11

Dean Christian Armada


People also ask

How do you fail readiness probe?

Increase the Failure Threshold of the Readiness Probe To increase the readiness probe failure threshold, configure the Managed controller item and update the value of "Readiness Failure Threshold". By default, it is set to 100 (100 times). You may increase it to, for example, 300 .

What is minReadySeconds?

minReadySeconds is an optional field that specifies the minimum number of seconds for which a newly created Pod should be read 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).

How does readiness probe work in Kubernetes?

The kubelet uses readiness probes to know when a container is ready to start accepting traffic. A Pod is considered ready when all of its containers are ready. One use of this signal is to control which Pods are used as backends for Services. When a Pod is not ready, it is removed from Service load balancers.

What happens to a container when the readiness probe fails?

If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure . If a container does not provide a readiness probe, the default state is Success .


1 Answers

From Kubernetes Deployment documentation:

.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

So your newly created app pod have to be ready for .spec.minReadySeconds seconds to be considered as available.

initialDelaySeconds: Number of seconds after the container has started before liveness or readiness probes are initiated.

So initialDelaySeconds comes before 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.

like image 198
nightfury1204 Avatar answered Oct 10 '22 18:10

nightfury1204