<p>I try to tell to K8s that my Pod is ready by the time there is a connection to MongoDB and Redis and an Express server is on.
I have configured: <code>initialDelaySeconds: 60</code> but the Pod is getting ready too soon after 20s, approximately:</p>
<p><a href="https://i.stack.imgur.com/UV7ij.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UV7ij.png" alt="enter image description here" /></a></p>
<p>See the 21s in the above picture..</p>
<p>Note: even if I configure to 5s, it takes around 20s anyways.</p>

Raz Buchnik
<p>I came along with this. Configuring a <code>startupProbe</code> before the <code>readinessProbe</code> fixed the issue for me.</p>
<pre><code>      startupProbe:
        httpGet:
          path: /health/?startup_probe=1
          port: 3003
        initialDelaySeconds: 3
        periodSeconds: 1
        timeoutSeconds: 5
      readinessProbe:
        httpGet:
          path: /health
          port: 3003
        initialDelaySeconds: 3
        periodSeconds: 3
        timeoutSeconds: 5
</code></pre>
<p>Such a way fixed the issue and also makes sure that the Pod is up and running even after its ready.</p>
<p>Notice that I added a <code>startup_probe</code> param so in the <code>startupProbe</code> which is only one time it will make a big check against the databases and in the <code>readinessProbe</code> it will just check against the API without invoking databases calls.</p>
