feat(tonic-xds): node metadata & AddOrigin layer#2617
Open
YutaoMa wants to merge 2 commits intohyperium:masterfrom
Open
feat(tonic-xds): node metadata & AddOrigin layer#2617YutaoMa wants to merge 2 commits intohyperium:masterfrom
YutaoMa wants to merge 2 commits intohyperium:masterfrom
Conversation
features required for Istio interop
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.
Motivation
tonic-xds doesn't currently interoperate with Istio's istiod. Two specific gaps surfaced during local Istio testing, and both affect any other real xDS control plane with the same shape:
node.metadata.GENERATOR = "grpc"(gRFC A27). Without it, istiod serves sidecar-style config that doesn't fit.:authority. The routing layer falls through to wildcard matches, so any control plane returning non-wildcard virtual hosts (Istio's*.svc.cluster.local, FQDN-based domains in general) doesn't route correctly. tonic's per-endpoint internalAddOriginruns after LB selection (keyed by endpoint IP:port, not service authority), so it can't substitute at the routing layer.Solution
tonic-xds/src/xds/bootstrap.rs) —NodeConfigparsesnode.metadatafrom the bootstrap JSON;From<NodeConfig> for Nodecarries it through.AddOriginLayer(tonic-xds/src/client/add_origin.rs) — a towerservice that rewrites each request's scheme + authority before
forwarding. Wired as the outermost layer in the xDS service stack, with
authority taken from the xDS target. Falls back to a no-op (with
tracing::warn) if the target isn't a valid authority. (grpc-godoes the equivalent inclientconn.go::initAuthority. )