-
Notifications
You must be signed in to change notification settings - Fork 10
Proxy envoy ADS requests to Consul server #4
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
Changes from 3 commits
8fc7c83
dc8c349
4dd7652
e2c2ec9
943f7a7
cd799a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import ( | |
| "net" | ||
| "os" | ||
| "strconv" | ||
| "strings" | ||
|
|
||
| "github.com/mitchellh/mapstructure" | ||
|
|
||
|
|
@@ -50,12 +51,8 @@ func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) ([]byte, error) | |
|
|
||
| args := &bootstrap.BootstrapTplArgs{ | ||
| GRPC: bootstrap.GRPC{ | ||
| // TODO(NET-99): This should be a listener on the consul-dataplane process | ||
| // that proxies streams to the server, handles load-balancing, SDS etc. | ||
| // | ||
| // For now we just give the server address directly. | ||
| AgentAddress: cdp.consulServer.address.String(), | ||
| AgentPort: strconv.Itoa(cdp.cfg.Consul.GRPCPort), | ||
| AgentAddress: cdp.cfg.XDSServer.BindAddress, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to eventually refactor this to not call things
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea for now we have copy-pasted a lot of this from the existing consul connect command in the consul repo. We can diverge to a more suitable naming at a later point. |
||
| AgentPort: strconv.Itoa(cdp.cfg.XDSServer.BindPort), | ||
| AgentTLS: false, | ||
| }, | ||
| ProxyCluster: rsp.Service, | ||
|
|
@@ -66,11 +63,19 @@ func (cdp *ConsulDataplane) bootstrapConfig(ctx context.Context) ([]byte, error) | |
| AdminBindAddress: envoy.AdminBindAddress, | ||
| AdminBindPort: strconv.Itoa(envoy.AdminBindPort), | ||
| LocalAgentClusterName: localClusterName, | ||
| // TODO(NET-148): Support login via an ACL auth-method. | ||
| Token: cdp.cfg.Consul.Credentials.Static.Token, | ||
| Namespace: rsp.Namespace, | ||
| Partition: rsp.Partition, | ||
| Datacenter: rsp.Datacenter, | ||
| Namespace: rsp.Namespace, | ||
| Partition: rsp.Partition, | ||
| Datacenter: rsp.Datacenter, | ||
| } | ||
|
|
||
| if cdp.localXDSServer != nil && cdp.localXDSServer.enabled { | ||
| if cdp.localXDSServer.listenerNetwork == "unix" { | ||
| args.GRPC.AgentSocket = cdp.localXDSServer.listenerAddress | ||
| } else { | ||
| xdsServerFullAddr := strings.Split(cdp.localXDSServer.listenerAddress, ":") | ||
| args.GRPC.AgentAddress = xdsServerFullAddr[0] | ||
| args.GRPC.AgentPort = xdsServerFullAddr[1] | ||
| } | ||
| } | ||
|
|
||
| var bootstrapConfig bootstrap.BootstrapConfig | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.