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

Consul Node.Name might be a DNS name #2208

Open
ggnaegi opened this issue Nov 20, 2024 · 3 comments
Open

Consul Node.Name might be a DNS name #2208

ggnaegi opened this issue Nov 20, 2024 · 3 comments
Assignees
Labels
bug Identified as a potential bug Consul Service discovery by Consul Service Discovery Ocelot feature: Service Discovery

Comments

@ggnaegi
Copy link
Member

ggnaegi commented Nov 20, 2024

Expected Behavior / New Feature

The consul service discovery provider should check if the node.Name could be a DNS/Host Name, otherwise return the service url.

Actual Behavior / Motivation for New Feature

The consul service provider doesn't check if the node.Name is a host name. Depending on service discovery configuration, the node.Name might not be a host name.

https://developer.hashicorp.com/consul/docs/agent

Node name: This is a unique name for the agent. By default, this is the hostname of the machine, but you may customize it using the -node flag.

Steps to Reproduce the Problem

  1. Change the agent name, use something that is not related to the hostname.
  2. Try to use the Consul Service Discovery

related to: #2203, #954

@ggnaegi ggnaegi self-assigned this Nov 20, 2024
@ggnaegi ggnaegi added bug Identified as a potential bug Consul Service discovery by Consul labels Nov 20, 2024
@raman-m
Copy link
Member

raman-m commented Nov 20, 2024

Adding an extra check for the DNS name could be a solution, providing some logic to protect Ocelot from careless DevOps engineers who might write whatever they want in the configs (in nodes). 😃 Gui, please note that an additional DNS probe for the node hostname will add 100+ milliseconds or even seconds to the request processing time, but we can cache the IP. But we could propose Boolean switcher of cache and entire DNS probe.

@ggnaegi
Copy link
Member Author

ggnaegi commented Nov 20, 2024

@raman-m you right, I think we should foresee an option for that matter

@raman-m raman-m changed the title Consul Node.Name might not be a DNS Name Consul Node.Name might be a DNS name Nov 20, 2024
@raman-m raman-m added the Service Discovery Ocelot feature: Service Discovery label Nov 20, 2024
@raman-m
Copy link
Member

raman-m commented Dec 26, 2024

@ggnaegi 🆗 man... You've opened the issue, and... What are you going to do with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identified as a potential bug Consul Service discovery by Consul Service Discovery Ocelot feature: Service Discovery
Projects
None yet
Development

No branches or pull requests

2 participants