Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthcheck endpoint to esi-leap #160

Closed
larsks opened this issue Jun 26, 2024 · 2 comments
Closed

Add healthcheck endpoint to esi-leap #160

larsks opened this issue Jun 26, 2024 · 2 comments

Comments

@larsks
Copy link
Member

larsks commented Jun 26, 2024

esi-leap should offer an http endpoint that does not require authentication that can be used in healthcheck scripts.

Podman, Docker, Kubernetes, and OpenShift all support healthchecks as a way to verify that a container is running properly. This is particularly useful in establishing dependencies between services.

@sheldor1510
Copy link
Contributor

Hi @larsks ! About the health check endpoint in OpenShift - https://docs.openshift.com/container-platform/4.9/applications/application-health.html - is this it? Also, according to you, how should we determine the up and running status for esi-leap? Would that be if the API is running with no authentication errors?

@larsks
Copy link
Member Author

larsks commented Jul 29, 2024

Sure, or https://docs.docker.com/reference/dockerfile/#healthcheck or for Docker and https://docs.docker.com/compose/compose-file/05-services/#healthcheck for Docker Compose.

The idea is simply to have an unauthenticated endpoint that can be used to positively detect when the esi-service is up and running.

Also, according to you, how should we determine the up and running status for esi-leap? Would that be if the API is running with no authentication errors?

The healthcheck endpoint is just a way of determining that the esi-leap application has completed initialization and is successfully serving requests. It doesn't need to perform any complex logic; it just needs to return a successful HTTP status code (200).


For example, the kubernetes API provides a health endpoint at /healthz:

$ curl https://api.shift.nerc.mghpcc.org:6443/healthz
ok

This is useful because all other requests require authentication. If I try to access /, I get an error code:

$ curl https://api.shift.nerc.mghpcc.org:6443/
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
  "reason": "Forbidden",
  "details": {},
  "code": 403
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants