mirror of
https://github.com/fsouza/fake-gcs-server.git
synced 2026-04-25 21:55:56 +03:00
[GH-ISSUE #904] Health Checks for Docker Compose #140
Labels
No labels
bug
compatibility-issue
docker
documentation
enhancement
help wanted
needs information
pull-request
question
stale
unfortunate
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/fake-gcs-server#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lauslim12 on GitHub (Aug 25, 2022).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/904
Hello!
I have a question: is it possible for this Fake GCS Server to have a dedicated endpoint for health checks? I am using
docker composeto provision my infrastructures for development purposes like the following:I'm trying to do health checks by pinging it like the following (via
curl, my Fake GCS server is hosted in192.168.1.6:4443):When I try to query/ping the Fake GCS server, it always returns
404 Not Found. Is this intentional? Is there any endpoints which I can use for health checks only? Because if I try to use the404 Not Foundstatus as my health check, the Docker will always mark the container as unhealthy, which is of course something that we do not want, and it is false negative (it works properly even when the state is in an unhealthy state).Thank you for your help and answer!
@fsouza commented on GitHub (Aug 25, 2022):
/storage/v1/bshould always work, as that list the buckets in the server (it'll just return an empty list if there are no buckets), but I could swear we had a dedicated healthcheck URL.We can add one at
/_internal/healthcheckor something like that, that's not a lot of work.edit: using a custom healthcheck URL is better because it won't do any host validation.
@lauslim12 commented on GitHub (Aug 26, 2022):
Sorry for the late response!
Apparently,
/storage/v1/bdoes not work either for me... I even have a bucket there already, but the server responds with404 Not Found.If we create a health check endpoint at
internal/healthcheck.go, do you have any idea on how to start working on that? I think I want to try to tackle this on (with your permission of course).In my mind...
/path, and it should return200 OKand nothing else.But what do you think?
@fsouza commented on GitHub (Aug 26, 2022):
@lauslim12 can you try #906?
@lauslim12 commented on GitHub (Aug 27, 2022):
Yep, that works properly. Thank you for adding the endpoint! Here, I will cross-post the configuration I use to perform the health check:
I performed the health check on my machine by doing:
In the Docker, it could be performed by doing:
We can implement it in Docker Compose as well:
Hope this helps anyone who wishes to implement the health checks!