-
Notifications
You must be signed in to change notification settings - Fork 41
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
Support configuring ServerName for HTTP health checks #102
Comments
@cbroglie, thanks for creating this issue and writing up all this context! If I understand correctly, it sounds like you’re using the IP address rather than the URL in the HTTP health check. If possible, I was wondering if you could share any context on using the IP address in the health check field? If not you’re not able to share, no worries. Thanks for going ahead and making the related Consul issue and PR to add the TLSServerName field. Agree with your point that it’s more explicit. Let’s wait to see what to see what the maintainers think. Regarding the alternative, it seems like to use this, users would be required to register the hostname in the header field of a health check. Is that right? Thanks! |
Our use case is integrating Consul with Kubernetes services which are exposed outside the cluster via Ingress or LoadBalancer service. It's a multi-tenant cluster where different Ingress resources share an IP address, and requests are routed based on SNI and Host header. Currently we have a wildcard DNS record pointing to the IP address (e.g.
Yes, that's correct. We'd need to do that for either proposal as our routing is based on both SNI and Host header. |
Hey! our usecase probably is the exact same as @cbroglie . I asked a while ago about this in consul discuss forum (https://discuss.hashicorp.com/t/consul-esm-http-health-check-by-another-host/11647) . However, not sure if ESM supports custom checks. Anyway, is there something which stops us to move forward with OP suggestion? Explicit or implicit configuration are fine by our usecase |
Hi @povils, thanks for the question! Regarding this original post, this is currently in progress. @ cbroglie created a PR with the required Consul-side changes first, which looks to be currently in review with a maintainer (you can see the progress here: hashicorp/consul#9475). I'll follow the issue to check on its progress. Regarding custom checks in general, ESM still currently does not support custom checks. I'll share a little of what our team is thinking about: currently a lot of health check changes (like custom checks) unfortunately require changing both Consul and ESM. We'd like to think about potentially decoupling these two. This might impact the design of custom checks, such as script checks, which is still on our radar as an important feature for many in the community. Hope that helps. Feel free to ask questions. Thanks! |
Fixed by #116 |
Some TLS servers require SNI, but the Golang HTTP client doesn't include it in the ClientHello when connecting to an IP address (TLS comes before HTTP, so it doesn't consider the Host header). This means the target of a HTTPS health check cannot be an IP address if the server requires SNI.
I believe making the server name configurable requires changing the API, so I created hashicorp/consul#9473 and hashicorp/consul#9475.
As an alternative, we could just address this in consul-esm without changing the API by looking at the Host header. It's less explicit, but isn't a new pattern. And the implementation could be as simple as:
The text was updated successfully, but these errors were encountered: