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

Healthcheck endpoint #16

Open
unixfox opened this issue Aug 14, 2024 · 2 comments
Open

Healthcheck endpoint #16

unixfox opened this issue Aug 14, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@unixfox
Copy link
Member

unixfox commented Aug 14, 2024

@techmetx11 we would like to offer an healthcheck endpoint. Could be used on Kubernetes or Docker.

What would be the ideal way? Have a separate very small HTTP server running which provides only a healthcheck?

Or sending some data using netcat to the code?

We would prefer to have something more in depth than just checking the port.

@unixfox unixfox added the enhancement New feature or request label Aug 14, 2024
@mini-bomba
Copy link
Contributor

I think the simplest way to implement the healthcheck would be to add a cmdline parameter to the main binary that instead of starting the server would check if the server is responsive, probably by sending a simple request like PLAYER_STATUS and waiting no more than 1 second for a response.

While K8s natively supports a variety of liveness probes, including commands and HTTP, docker and podman appear to only support running healthcheck commands inside the container. Checking the HTTP healthcheck endpoint in docker and podman would require including an http client binary in the image, including any dependencies if dynamically linked. (the final image is built from scratch) Another rust dependency would likely need to be included for the HTTP server.

On the other hand, implementing a command-based healthcheck would only require adding another cmdline flag to check the server and exit with either 0 or 1.

@techmetx11
Copy link
Collaborator

I think the simplest way to implement the healthcheck would be to add a cmdline parameter to the main binary that instead of starting the server would check if the server is responsive, probably by sending a simple request like PLAYER_STATUS and waiting no more than 1 second for a response.

While K8s natively supports a variety of liveness probes, including commands and HTTP, docker and podman appear to only support running healthcheck commands inside the container. Checking the HTTP healthcheck endpoint in docker and podman would require including an http client binary in the image, including any dependencies if dynamically linked. (the final image is built from scratch) Another rust dependency would likely need to be included for the HTTP server.

On the other hand, implementing a command-based healthcheck would only require adding another cmdline flag to check the server and exit with either 0 or 1.

We just need a simple flag in the main binary, no need for any HTTP-related stuff.

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

No branches or pull requests

3 participants