GFlisch / Arc4u.Guidance.Doc

Other
5 stars 1 forks source link

Implement a LoadBalancer health endpoint to be used by a loadbalancer to check if a service is up and running. #226

Open GFlisch opened 7 months ago

GFlisch commented 7 months ago

Today the Guidance is generating different health endpoints: one for healthChecks-UI, one for readiness probe nad liveness one for k8s. In our current infra we are using F5 and we would like to have a light LoadBalancer endpoint to just check that the service is running. With no extra heavy checks.

Describe the solution you'd like Just add a new one for the load balancer

app.MapHealthChecks("/health/ready", new HealthCheckOptions()
{
    Predicate = (check) => check.Tags.Contains("ready"),
});
app.MapHealthChecks("/health/live", new HealthCheckOptions()
{
    Predicate = (check) => check.Tags.Contains("live")
});
app.MapHealthChecks("healthz", new HealthCheckOptions()
{
    Predicate = _ => true,
    ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});

app.MapHealthChecks("/health/loadbalancer", new HealthCheckOptions() { Predicate = (check) => check.Tags.Contains("loadbalancer"), });

rdarko commented 7 months ago

Can you please recreate ticket without specifiying which tools are we using? @GFlisch