<p>I have a deployment with 2 replicas of Nginx. It has only the liveness probe to monitor the health of the service. Due to high traffic, my liveness probe fails, the Nginx container is restarted, but the pod status running state and Pod condition is Ready. Due to that POD, IP is not removed the service endpoint and request were send to restarting pod which results in some failures.</p>

Rakesh
<p>As per <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes" rel="nofollow noreferrer">container probes</a>:</p>

<blockquote>
  <ul>
  <li><p><code>livenessProbe</code>: Indicates whether the Container is running. If the liveness probe fails, the kubelet kills the Container, and the
  Container is subjected to its restart policy [...]</p></li>
  <li><p><code>readinessProbe</code>: Indicates whether the Container is ready to service requests. <strong>If the readiness probe fails, the endpoints
  controller removes the Pod’s IP address from the endpoints of all
  Services</strong> that match the Pod [...]</p></li>
  </ul>
</blockquote>

<p>You need to <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-readiness-probes" rel="nofollow noreferrer">add a readinessProbe</a> to grant that the endpoints of unhealthy containers will be removed.</p>

<blockquote>
  <p>Readiness probes are configured similarly to liveness probes. The only
  difference is that you use the <code>readinessProbe</code> field instead of the
  <code>livenessProbe</code> field.</p>
</blockquote>
