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 /status endpoint for k8s or other probe systems #93

Closed
aimxhaisse opened this issue Aug 22, 2024 · 4 comments
Closed

Add /status endpoint for k8s or other probe systems #93

aimxhaisse opened this issue Aug 22, 2024 · 4 comments

Comments

@aimxhaisse
Copy link
Contributor

Context: Kubernetes has a system of probes, which regularly pings a service with HTTP queries to know if it's healthy or not. If the service fails to reply it will automatically restart it / reschedule it, potentially on another machine.

This is usually implemented exporting a dummy /status endpoint which returns 200 on one of the services exported by the application, as a starting point this likely could be part of the metrics module.

@aimxhaisse
Copy link
Contributor Author

I'll have a PR for it soon.

@aimxhaisse
Copy link
Contributor Author

#94

@aimxhaisse
Copy link
Contributor Author

aimxhaisse commented Aug 22, 2024

Alternatively/likely longer term, we can introduce a cb_probe module which exports:

  • /ready: once the module has loaded its config and is ready
  • /status: always return a 200

This would help a lot with k8s, where we could configure it to wait for /ready to return a 200 then expose the service to your stack/delete previous deployments/and rely on /status. If there is a slower startup step at some point (for instance to load mapping of lido keys or similar), ready would return a 500 until properly loaded. That way upgrades would have 0 downtime even if there is a block proposal right in the middle, k8s will route to the previous instance until the new one is ready.

@aimxhaisse
Copy link
Contributor Author

Marking as done for now, I'll follow up with a dedicated cb_probe module once the k8s initial draft works.

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

1 participant