<p>I have an application running in Kubernetes. To take the advantage of rolling updates with no downtime, I have to implement the proper Health Checks, so the cluster can know when the application/container is ready to handle requests.</p>

<p>I'm trying to use the <a href="https://blogs.msdn.microsoft.com/webdev/2018/08/22/asp-net-core-2-2-0-preview1-healthcheck/" rel="noreferrer">new ASP.NET Code 2.2 Healthchecks</a> feature.</p>

<p>I should return a <code>Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckResult</code> struct with the status of the application.</p>

<p>This struct has 3 static methods that I can use to return this status:</p>

<ul>
<li>Healthy</li>
<li>Unhealthy</li>
<li>Degraded</li>
</ul>

<p>In which situations that the app is not OK that I should use Unhealthy vs Degraded? A few examples would be good.</p>

lmcarreiro
<p>A "degraded" check could be used for checks that did succeed but are slow or unstable. E.g. a simple database query did succeed but took more than a second. Moving traffic to another instance is probably a good idea until the problem has resolved.</p>

<p>An "unhealthy" check means that the component does not work at all. E.g. a connection to the Redis cache could no be established. Restarting the instance could solve this issue.</p>

<p>Quoting the blog post:</p>

<blockquote>
  <p><strong>A failed liveness probe says:</strong> The application has crashed. You should
  shut it down and restart.</p>
  
  <p><strong>A failed readiness probe says:</strong> The application is OK but not yet ready
  to serve traffic.</p>
</blockquote>

<p>You could say that a "degraded" health check maps to the "readiness" probe and an "unhealthy" check maps to the "liveness" probe.</p>
