feat(server-ng): add cluster.nodes.advertised_address for clients - #3757
Merged
Conversation
A node's `ip` is the address it binds for replica traffic, which in Docker, Kubernetes, or NAT deployments is private. Both client-facing surfaces reuse it: the cluster roster returned to clients and the follower's redirect to the metadata primary. Clients outside the replica network get an address they cannot reach. Nodes now take an optional `advertised_address` that overrides `ip` only where an address is handed to a client. Replica traffic still uses `ip`, so the two planes can live on separate networks. Left unset, behavior is unchanged. The field is typed as a string but validated as a literal IP, leaving room to accept hostnames later without a config-format break. Validation now checks advertised client endpoints for conflicts alongside the existing bind-endpoint check, since two nodes on distinct private IPs can otherwise publish the same client address and silently shadow each other. Node entries also reject unknown fields, so a misspelled advertised_address fails at startup instead of silently leaving the private ip in client responses.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3757 +/- ##
=============================================
- Coverage 74.58% 60.55% -14.04%
Complexity 969 969
=============================================
Files 1306 1305 -1
Lines 150282 138231 -12051
Branches 125715 113738 -11977
=============================================
- Hits 112088 83703 -28385
- Misses 34690 50941 +16251
- Partials 3504 3587 +83
🚀 New features to boost your workflow:
|
mmodzelewski
force-pushed
the
advertised_ip
branch
from
July 27, 2026 15:54
538eebc to
96a90b4
Compare
hubcio
previously approved these changes
Jul 27, 2026
hubcio
previously approved these changes
Jul 27, 2026
numinnex
previously approved these changes
Jul 27, 2026
hubcio
approved these changes
Jul 28, 2026
spetz
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A node's
ipis the address it binds for replica traffic, which inDocker, Kubernetes, or NAT deployments is private. Both client-facing
surfaces reuse it: the cluster roster returned to clients and the
follower's redirect to the metadata primary. Clients outside the
replica network get an address they cannot reach.
Nodes now take an optional
advertised_addressthat overridesiponly where an address is handed to a client. Replica traffic still
uses
ip, so the two planes can live on separate networks. Leftunset, behavior is unchanged.
The value parses into an
AdvertisedAddress: a literal IP or anRFC 1123 hostname, rejecting ports, empty labels, and dotted-numeric
strings that are really malformed IPv4, so
10.0.0.256fails at bootinstead of reaching DNS. Hostnames normalize to lowercase and IPs to
canonical form, so textual variants of one address compare equal and
publish identically; IPv6 hosts are bracketed when rendered with a
port.
Validation now also checks advertised client endpoints for conflicts
alongside the existing bind-endpoint check, since two nodes on
distinct private IPs can otherwise publish the same client address
and silently shadow each other. Only client transports take part,
as replica ports never carry an advertised address. A roster
ipthat parses as neither IP nor hostname stays legal (Docker service
names with underscores exist in the wild) and falls back to
raw-string comparison instead of failing boot.
Node entries also reject unknown fields, so a misspelled
advertised_address fails at startup instead of silently leaving the
private ip in client responses.