Skip to content

Conversation

@jabr
Copy link
Contributor

@jabr jabr commented Oct 27, 2025

Related issue: #154

Added "nearest" internal DNS mode the puts machine-local IPs at the start of responses. Also added a "rr" mode that has the same, random shuffle behavior of the current default.

I've tested this build on my cluster.

@jabr jabr changed the title feat: Adding a "nearest.service.local" mode to internal DNS feat: Adding a "nearest.service.local" mode to internal DNS (draft) Oct 27, 2025
Copy link
Owner

@psviderski psviderski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition to the list of supported internal DNS records! 👏

Everything looks good, just one note on not coupling the server implementation with the details of uncloud networking.

I did some research and not sure if need to change the default to nearest: #154 (comment)
Perhaps leaving the current random behaviour is fine.

Please let me know once you test this. Also would be nice to add the info about the new record to the doc page you wrote earlier 🙏

Awesome work as always! ❤️

@jabr
Copy link
Contributor Author

jabr commented Oct 27, 2025

Just trying out an idea, but I also added a "rr" mode with an explicit round-robin (rather than random) based on a count of total lookups the server has resolved so far (so not really round-robin, I guess, as it's not specific to that exact name...). The default behavior is still just random shuffle. I'll follow up in #154.

@psviderski
Copy link
Owner

I'm not sure if the approach based on resolvedCount is any different to the random one in the case where there are many local services making many requests. I think random should statistically provide even distribution which IMO is good enough. Note that Caddy's default LB policy is also random.

jabr added 4 commits October 27, 2025 19:27
…ork.MachineIP)

Also adds an exact round-robin via "rr.{service}" mode. Not sure we want that over random or not, though.
… now the same as default with random shuffle.
@jabr jabr force-pushed the internal-dns-enhancements branch from 62d0c87 to db81ff3 Compare October 28, 2025 03:56
@jabr
Copy link
Contributor Author

jabr commented Oct 28, 2025

  1. Removed the count based rotation mode for rr and just made it use the (current) default of random shuffle alone
  2. Added a test on the nearest ordering
  3. Added docs on the rr and nearest prefixes

I think it's good to go now, but let me know if you have any notes.

@jabr jabr changed the title feat: Adding a "nearest.service.local" mode to internal DNS (draft) feat: Adding a "nearest.service.local" mode to internal DNS Oct 28, 2025
@psviderski psviderski merged commit ba6290d into psviderski:main Oct 29, 2025
4 checks passed
@jabr jabr deleted the internal-dns-enhancements branch November 13, 2025 06:33
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

Successfully merging this pull request may close these issues.

2 participants