<p>I am aware of how replicaset works and how it will reconcile the state from its specification .</p>
<p>However, I am not completely aware of what are all the criteria Replicaset uses for it it to reconcile the state ?</p>
<p>I happened to take look the documentation to understand the scenarios.
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/</a></p>
<ol>
<li>One scenarios is when the pod is down for any reason - application issue</li>
<li>Node is down</li>
</ol>
<p>What are all the other scenarios ? If the pod is stuck in making progress, will replica set take care of that ? Or is it just check whether the pod is alive or not ?</p>

<blockquote>
<p>If the pod is stuck in making progress, will replica set take care of that ?</p>
</blockquote>
<p>As long as the main process inside of a container is running, it is considered healthy by default and it will be treated as such. If there is an application issue which prevents your application from working correctly but the main process is still running, you will be stuck with an &quot;unhealthy&quot; pod.</p>
<p>That is the reason why you want to implement <code>livenessProbe</code> for your containers and specify what &quot;behavior&quot; represents a healthy state of the container. In such scenario, failure to successfully respond to health check multiple times (configurable) will result in a container being treated as failed and your replica set will take an action.</p>
<p>Example might be a simple HTTP GET request to some predefined path if you are running web application in your pod (eg <code>/api/health</code>). Now, even if main process is running, your application needs to periodically respond to this health-check query otherwise it will be replaced.</p>
