A proxy-wide health check route #103
Replies: 9 comments
-
Hi! I've encountered the same problem and would be happy to contribute to solving it. Before Kamal v2.0, I resolved this issue using Traefik labels to route traffic based on specific User-Agent headers. Since I have both a FE and BE applications hosted on the same server, I need to separate my health checks:
I believe we should add an option that allows routing based on headers and paths, not just the host, as I don’t see any other way to handle managed load balancers' health checks due to the limited request information they provide. Alternatively, we could add a way to easily expose the container port, like |
Beta Was this translation helpful? Give feedback.
-
As a workaround for now, you can deploy the smallest (around 80Kb) image https://hub.docker.com/r/lipanski/docker-static-website without the |
Beta Was this translation helpful? Give feedback.
-
Thank you! I temporarily changed the range (200-499) of my health checks since it’s pointless anyway, but I didn’t know that image exists. :)) |
Beta Was this translation helpful? Give feedback.
-
Help me understand the problem here. The proxy/ssl|host settings are only relevant when you're running with a single box. Why would there be a load balancer in front then? |
Beta Was this translation helpful? Give feedback.
-
The problem is that almost all balancers allow to define only an HTTP path and port as a healthcheck. This works well when you have a single app on the host. Imagine yourself having a balancer. It sends a Currently, kamal-proxy will respond with HTTP 404, which makes sense because it will not wind a container to route traffic to. The idea is to add a default traffic point like |
Beta Was this translation helpful? Give feedback.
-
Running into this with the upgrade to 2.0 (very excited to drop Traefik!). With Kamal 1*, we have TLS terminating on our load balancers (AWS ELB), however, we maintained TLS right through to hosts using self signed certificates with Traefik. This ensures traffic is encrypted from client => load balancer => host. In some ways you're right, it doesn't make sense to leverage Kamal Proxy's auto SSL stuff in this setup, but it would be nice to support encryption across all network hops whilst keeping the proxy set up simple. #17 might address this scenario, but still requires setting a host (as far as I can tell). Not sure it will work with something like the following. Will test this once kamal supports the custom TLS stuff that appears to now be supported in Kamal Proxy. proxy:
ssl: true
ssl_certificate: /....
ssl_private_key: /...
hosts: * |
Beta Was this translation helpful? Give feedback.
-
I have applications deployed horizontally, with three web app servers behind an AWS ALB, which handles SSL termination and health checks. The ALB health check request looks like this:
unfortunately, there is no option to add custom headers (like |
Beta Was this translation helpful? Give feedback.
-
This is related to the issue I submitted in the kamal repo: I think the solution should be to add a "default" host to the proxy. Useful also when you want an app to show when you visit the IP address. |
Beta Was this translation helpful? Give feedback.
-
We really need "default host" option. I don't understand why this isn't already available. I am looking to move away from kamal. It's not enough to just allow single server deployment, we need to be able to put it behind load balancer for obvious reasons. |
Beta Was this translation helpful? Give feedback.
-
Cloud load balancers like AWS ALB or DigitalOcean droplet balancer does not allow specifying HOST header that is getting sent to the instance. In a multi-application setup, this means two things:
proxy: { host: nil }
setting.Based on these two facts, I suggest adding an ability to specify a proxy-wide health check route that will work for all instances.
Beta Was this translation helpful? Give feedback.
All reactions