-
Notifications
You must be signed in to change notification settings - Fork 325
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
peering: support peering establishment over mesh gateways, remove ability to pass external addresses to token generation endpoint #1610
Changes from all commits
2f52a5e
e002fe4
908a585
3caf84a
e696145
bfc0bf0
eefa004
3485e26
42994da
2fde3bf
e66b034
abd53e1
cefc722
5ea134f
fb6d811
688bf18
f3782ae
6a97224
da61b7d
5e4f6c8
aa7391a
06a9ec7
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- meshpeering.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: Mesh | ||
metadata: | ||
name: mesh | ||
spec: | ||
peering: | ||
peerThroughMeshGateways: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ func TestPeering_Connect(t *testing.T) { | |
|
||
"dns.enabled": "true", | ||
"dns.enableRedirection": strconv.FormatBool(cfg.EnableTransparentProxy), | ||
"peering.tokenGeneration.serverAddresses.source": "consul", | ||
} | ||
|
||
staticServerPeerHelmValues := map[string]string{ | ||
|
@@ -90,8 +91,6 @@ func TestPeering_Connect(t *testing.T) { | |
staticServerPeerHelmValues["server.exposeGossipAndRPCPorts"] = "true" | ||
staticServerPeerHelmValues["meshGateway.service.type"] = "NodePort" | ||
staticServerPeerHelmValues["meshGateway.service.nodePort"] = "30100" | ||
staticServerPeerHelmValues["server.exposeService.type"] = "NodePort" | ||
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. QQ: why are we removing the grpc port configs for each of these? 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. We no longer need the exposeService at all for peering connections, so this removes any configuration of it. |
||
staticServerPeerHelmValues["server.exposeService.nodePort.grpc"] = "30200" | ||
} | ||
|
||
releaseName := helpers.RandomName() | ||
|
@@ -107,15 +106,13 @@ func TestPeering_Connect(t *testing.T) { | |
} | ||
|
||
if !cfg.UseKind { | ||
staticServerPeerHelmValues["server.replicas"] = "3" | ||
staticClientPeerHelmValues["server.replicas"] = "3" | ||
} | ||
|
||
if cfg.UseKind { | ||
staticClientPeerHelmValues["server.exposeGossipAndRPCPorts"] = "true" | ||
staticClientPeerHelmValues["meshGateway.service.type"] = "NodePort" | ||
staticClientPeerHelmValues["meshGateway.service.nodePort"] = "30100" | ||
staticClientPeerHelmValues["server.exposeService.type"] = "NodePort" | ||
staticClientPeerHelmValues["server.exposeService.nodePort.grpc"] = "30200" | ||
} | ||
|
||
helpers.MergeMaps(staticClientPeerHelmValues, commonHelmValues) | ||
|
@@ -124,6 +121,20 @@ func TestPeering_Connect(t *testing.T) { | |
staticClientPeerCluster := consul.NewHelmCluster(t, staticClientPeerHelmValues, staticClientPeerClusterContext, cfg, releaseName) | ||
staticClientPeerCluster.Create(t) | ||
|
||
// Create Mesh resource to use mesh gateways. | ||
logger.Log(t, "creating mesh config") | ||
kustomizeMeshDir := "../fixtures/bases/mesh-peering" | ||
|
||
k8s.KubectlApplyK(t, staticServerPeerClusterContext.KubectlOptions(t), kustomizeMeshDir) | ||
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { | ||
k8s.KubectlDeleteK(t, staticServerPeerClusterContext.KubectlOptions(t), kustomizeMeshDir) | ||
}) | ||
|
||
k8s.KubectlApplyK(t, staticClientPeerClusterContext.KubectlOptions(t), kustomizeMeshDir) | ||
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { | ||
k8s.KubectlDeleteK(t, staticClientPeerClusterContext.KubectlOptions(t), kustomizeMeshDir) | ||
}) | ||
|
||
// Create the peering acceptor on the client peer. | ||
k8s.KubectlApply(t, staticClientPeerClusterContext.KubectlOptions(t), "../fixtures/bases/peering/peering-acceptor.yaml") | ||
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() { | ||
|
@@ -261,6 +272,7 @@ func TestPeering_Connect(t *testing.T) { | |
} else { | ||
k8s.CheckStaticServerConnectionSuccessful(t, staticClientOpts, staticClientName, "http://localhost:1234") | ||
} | ||
|
||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because I noticed that by the time the peering is established and the exported service is actually replicated to the other side, this curl was timing out. It is taking a bit longer for the peering to get set up-- things that cause this are dialing a follower node and needing to retry the peering, a delta xds bug that causes the mesh gateways to take extra time to get their config.