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

Allow specifying separate port for health check #1234

Open
petromir opened this issue Nov 20, 2024 · 7 comments
Open

Allow specifying separate port for health check #1234

petromir opened this issue Nov 20, 2024 · 7 comments

Comments

@petromir
Copy link

petromir commented Nov 20, 2024

I have the following settings of the proxy in kamal.yaml file

proxy:
  app_port: 8080
  response_timeout: 10
  healthcheck:
    interval: 3
    path: /health
    timeout: 3

Usually, the "management" (a.k.a observability - health, metrics, prometheus etc.) endpoints are served on a different port not exposed to outside world, e.g. 8181

Could you please add another property to specify different port for the health check, so we end up with

proxy:
  app_port: 8080
  response_timeout: 10
  healthcheck:
    interval: 3
    path: /health
    port: 8181 # the new shiny property
    timeout: 3
@igor-alexandrov
Copy link
Contributor

@djmb I can implement this if you are okay to adding this.

@a3kov
Copy link

a3kov commented Nov 27, 2024

Even though I agree such feature could be useful, I want to note - last time I checked Kamal does the healthcheck on the IP address and not on the domain (i.e. host header is empty) so it's already hidden from the outside world - Kamal proxy only forwards domain requests. So the only thing currently needed is for your app not to return health check responses with domain requests.

As it is unclear if the current behavior is intended or simply a coincidence, it would certainly be better being able to explicitly configure it

@petromir
Copy link
Author

the only thing currently needed is for your app not to return health check responses with domain requests.

I prefer configuration over coding a filter. With the port configuration I don't even need to change the firewall in my server provider.

@igor-alexandrov
Copy link
Contributor

@petromir I was wrong in my initial answer. Kamal and kamal-proxy require health check route to be exposed outside the container, as the health check functionality is implemented directly in the kamal-proxy server.

@petromir
Copy link
Author

petromir commented Dec 4, 2024

@igor-alexandrov exposing it outside of the container is not an issue, just the port as I don't want to use the one open to the public.

@petromir
Copy link
Author

@igor-alexandrov any movement around this?

@igor-alexandrov
Copy link
Contributor

Unfortunately, nothing from my side due to a lack of time. I hope it will get better soon.

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