Skip to content

connect: generate the full SNI names for discovery targets in the compiler rather than in the xds package #6340

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

Merged
merged 6 commits into from
Aug 19, 2019

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented Aug 16, 2019

Note this is layered over #6324

One side effect is that you need to enable connect for the /v1/discovery-chain/ endpoint to work.

@rboyer rboyer added the theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies label Aug 16, 2019
@rboyer rboyer added this to the 1.6.0-final milestone Aug 16, 2019
@rboyer rboyer requested a review from a team August 16, 2019 17:41
@rboyer rboyer self-assigned this Aug 16, 2019
@banks
Copy link
Member

banks commented Aug 19, 2019

(Pre-flight comments)

One side effect is that you need to enable connect for the /v1/discovery-chain/ endpoint to work.

Only on servers still though right? Do we have a helpful error if it's not enabled? If so I think that's fine for now, discovery chain kinda requires Connect for now. If we do extend it to control regular Service Discovery APIs later we might need to review this (i.e. make sure enough of it still works without connect enabled for basic discovery/failover without SNI).

Copy link
Member

@banks banks left a comment

Choose a reason for hiding this comment

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

Looks good. I had a couple of questions inline that might have good reasons to leave as they are and are fine if so so approving anyway but see what you think.

@@ -111,7 +112,7 @@ func (s *Server) clustersFromSnapshotMeshGateway(cfgSnap *proxycfg.ConfigSnapsho
// generate the service subset clusters
for svc, resolver := range cfgSnap.MeshGateway.ServiceResolvers {
for subsetName, _ := range resolver.Subsets {
clusterName := ServiceSNI(svc, subsetName, "default", cfgSnap.Datacenter, cfgSnap)
clusterName := connect.ServiceSNI(svc, subsetName, "default", cfgSnap.Datacenter, cfgSnap.Roots.TrustDomain)
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to take this from the API (new Name field) instead of keeping the duplicated logic? I think that should be available form the target here right?

I don't think it matters too much for now if it's hard for some reason but it seems to be bypassing the new source of truth being the API rather than just shared conventions?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the mesh gateway branch of the xds code that doesn't talk to the discovery chain.

@rboyer rboyer changed the base branch from external-sni-config to release/1-6 August 19, 2019 17:20
@rboyer rboyer merged commit 561b2fe into release/1-6 Aug 19, 2019
@rboyer rboyer deleted the chain-sni branch August 19, 2019 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants