<p>Can someone please tell what is the issue with my yaml file for deployment. When I remove readiness probe, I can see my deplyoment in <code>kubectl get deployments</code> as available. But with readiness probe, it remains unavailable as below.</p>

<pre><code>NAME           DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
neg-demo-app   1         1         1            0           2m33s
</code></pre>

<p>Below is my yaml file </p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: neg-demo-app # Label for the Deployment
  name: neg-demo-app # Name of Deployment
spec: # Deployment's specification
  minReadySeconds: 60 # Number of seconds to wait after a Pod is created and its status is Ready
  selector:
    matchLabels:
      run: neg-demo-app
  template: # Pod template
    metadata:
      labels:
        run: neg-demo-app # Labels Pods from this Deployment
    spec: # Pod specification; each Pod created by this Deployment has this specification
      containers:
      - image: container_name  # Application to run in Deployment's Pods
        name: hostname # Container name
        livenessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
        readinessProbe:
          httpGet:
            path: /healthz
            port: 8080
            scheme: HTTP
      terminationGracePeriodSeconds: 60 # Number of seconds to wait for connections to terminate before shutting down Pods
</code></pre>

<p>What i think you have added the </p>

<pre><code>minReadySeconds: 60 # Number of seconds to wait after a Pod is created and its status is Ready
</code></pre>

<blockquote>
  <p>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 is 0 (the Pod will be considered available as
  soon as it is ready).</p>
</blockquote>

<pre><code>So your newly created app pod have to be ready for minReadySeconds 60 seconds to be considered as available.


initialDelaySeconds: Number of seconds after the container has started before liveness or readiness probes are initiated.
</code></pre>

<blockquote>
  <p>So initialDelaySeconds comes before minReadySeconds.</p>
</blockquote>

<pre><code>container in the pod has started at 5 seconds. Readiness probe will be initiated at 5+initialDelaySeconds seconds. Assume Pod become ready at 7 seconds(7 &gt; 5+initialDelaySeconds). So this pod will be available after 7+minReadySeconds seconds.
</code></pre>

<p>Please try adding the <code>initialDelaySeconds</code> in rediness probe and liveness probe otherwise try with removing the <code>minReadySeconds</code>.</p>
