-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[question] Services using Consul Connect and TCP Checks? #9945
Comments
Hi @evandam When Consul Connect is enabled, the application (redis in this case) is usually configured to listen on localhost and Nomad will configure the Envoy proxy to act as a gateway to your application. Consul (which executes the tcp check) sits in the host's network namespace where this allocation will have its own network namespace. This means that Consul can't perform a meaningful tcp health check because it can't reach redis over plaintext (because of the separate network namespaces) and performing a tcp check against the Envoy proxy only checks that Envoy is listening. I want to call out the Finally I wanted to point out one more thing in your jobfile. You do not need to define
I hope this helps, please let us know if you have more questions. |
Thanks @nickethier! I also noticed that I tried switching the Here's my HCL: https://gist.github.com/evandam/6642b3ff3dcf49baaa97da2635a31dae I'm testing with this: nomad alloc exec -task evandam-redis-client -job evandam-redis redis-cli ping Note with the first one you get
I think there's something going on like the sidecar proxy is using the wrong port? Not sure if this is a separate problem - happy to open a new issue if needed. Thanks! |
Ah yes script checks are a great option too!! I forked your gist and made some changes and added comments. I figured that would translate better: https://gist.github.com/nickethier/dbb4312a66f7688d37fcf71a246b55cc/revisions That should get you going. Let me know if it doesn't. Also as an FYI we have a discuss board where we like to direct questions. This issue is totally fine just letting you know for future reference. |
Thanks @nickethier I think this makes perfect sense for majority of use cases using Consul Connect, but I was looking at things slightly differently. While this example is using Redis, a more practical example is a service that connects to upstream services using Consul Connect, but should also be accessible with Fabio. In this case, I actually want the port stanza so it can be accessed from the host network by Fabio. I realize it goes around some of the security benefits of Consul Connect, but it seems to be the only option to keep things working with services like Fabio. Either way, I'll keep the discussion board in mind for the future! |
Ah I see then in that case, uncommenting the port stanza should get you there. It sounds like we can close this issue. Please let me know if thats not the case. Thanks! |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
Nomad v1.0.3 (08741d9f2003ec26e44c72a2c0e27cdf0eadb6ee)
Operating system and Environment details
Ubuntu 18.04
Issue
Hi folks,
I was just hoping for some clarification around Consul Connect and TCP health checks.
I have a Nomad job to run a Redis server that previously used a TCP check that I would like to use with Consul Connect, but it's not allowed. I'm not sure if this is an issue on the Nomad or Consul side, though.
Not all of our services use Consul Connect (ex: Fabio), so I'm still using a named port and publishing it so other services can connect to
evandam-redis.service.consul
if needed.My assumption is that TCP checks are not allowed, thinking that the port will not be accessible outside of the bridge network? However, with this approach Consul should still be able to reach the port to do a TCP check. Is my understanding of this correct?
Reproduction steps
Job file
The text was updated successfully, but these errors were encountered: