<p>I have following setting for readiness probe:</p>

<pre><code> readinessProbe:
      httpGet:
        path: /xyzapi/health
        port: 8888
      initialDelaySeconds: 30
      periodSeconds: 30
      timeoutSeconds: 30
      successThreshold: 2
      failureThreshold: 5
</code></pre>

<p>I want this readiness probe to be hit only once. It should fail or pass my deployment base on one try only.</p>

<p>I did some googling, but not much of help. Any kube expert? please help.</p>

<p>Oswin Noetzelmann's comment is spot-on. The purpose of a readiness probe is to continually check for the state of readiness. You can probably still change it so that your readiness-check script checks once and then caches that result, but it wouldn't be idiomatic use of readiness. </p>

<p>Better alternatives for a one-time check are: init-containers or just using a wrapper script which wraps the actual work of your main container and performs the check you want.</p>

<p>I think it is a good use case for <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#what-can-init-containers-be-used-for" rel="nofollow noreferrer">init-containers</a>. From the documentation, one of the common purposes of init containers is:</p>

<blockquote>
  <p>They run to completion before any app Containers start, whereas app
  Containers run in parallel, so Init Containers provide an easy way to
  block or delay the startup of app Containers until some set of
  preconditions are met.</p>
</blockquote>
