<p>I'm wondering what <code>timeoutSeconds</code> actually does in a liveness or readiness probes?</p>
<p>The <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/" rel="noreferrer">documentation</a> states that:</p>
<blockquote>
<p><code>timeoutSeconds</code>: Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1.</p>
</blockquote>
<p>No more explanation or demonstration of how to use it and what actually it does.</p>
<p>So what is this parameter's job and how can it be differentiated from <code>periodSeconds</code>?</p>
<p>I was lucky to find this <a href="https://stackoverflow.com/a/48578390/3423768">answer</a> but it's still fuzzy to me. Specially after I saw this diagram from <a href="https://www.openshift.com/blog/liveness-and-readiness-probes" rel="noreferrer">here</a>:</p>
<p><a href="https://i.stack.imgur.com/LA13u.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LA13u.png" alt="enter image description here" /></a></p>
<p>I also tried playing around with the values to find out how things work and what is the effect of this parameter but no luck as events do not seem to take place immediately.</p>

<p>The <code>periodSeconds</code> specifies how often a container running within a pod will be probed (tested) and the <code>timeoutSeconds</code> specifies how quickly the container needs to respond to the probe.</p>
<p>Let's say that you have set <code>periodSeconds</code> to 3 and <code>timeoutSeconds</code> to 1. In this setup, container will be probed every 3 seconds and each time it is being probed, it has 1 second to respond otherwise it fails that one probe (even if it responds later to that probe, say in 2 seconds).</p>
<p>The diagram is quite precise. It tells you that nothing is happening during the <code>initialDelaySeconds</code> which is a time the container has before it starts being probed (so that it has enough time to start all the necessary processes). After this time expires, it starts being probed.</p>
<p>It successfully responds to the first probe within <code>timeoutSeconds</code>, then there is a delay <code>periodSeconds</code> before it is probed again. This time it fails to respond within <code>timeoutSeconds</code> and there is another <code>periodSeconds</code> delay and it fails again and again and then then pod is being restarted because that is how it was configured in this case (to restart after 3 consecutively failed probes, given by <code>failureThreshold</code>)</p>
