Skip to content
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

consul/connect: Enable running multiple ingress gateways per Nomad agent #9849

Merged
merged 4 commits into from
Jan 20, 2021

Conversation

shoenig
Copy link
Member

@shoenig shoenig commented Jan 19, 2021

Connect ingress gateway services were being registered into Consul without
an explicit deterministic service ID. Consul would generate one automatically,
but then Nomad would have no way to register a second gateway on the same agent
as it would not supply 'proxy-id' during envoy bootstrap.

Set the ServiceID for gateways, and supply 'proxy-id' when doing envoy bootstrap.

Fixes #9834

@vercel vercel bot temporarily deployed to Preview – nomad January 19, 2021 16:30 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 19, 2021 16:30 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 19, 2021 18:11 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad January 19, 2021 18:11 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 19, 2021 18:47 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad January 19, 2021 18:47 Inactive
Connect ingress gateway services were being registered into Consul without
an explicit deterministic service ID. Consul would generate one automatically,
but then Nomad would have no way to register a second gateway on the same agent
as it would not supply 'proxy-id' during envoy bootstrap.

Set the ServiceID for gateways, and supply 'proxy-id' when doing envoy bootstrap.

Fixes #9834
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 19, 2021 18:58 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad January 19, 2021 18:58 Inactive
@@ -516,7 +518,7 @@ func TestTaskRunner_EnvoyBootstrapHook_gateway_ok(t *testing.T) {

// the only interesting thing on bootstrap is the presence of the cluster,
// everything is configured at runtime through xDS
require.Equal(t, "my-ingress-service", out.Node.Cluster)
require.Equal(t, "ingress-gateway", out.Node.Cluster)
Copy link
Member Author

Choose a reason for hiding this comment

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

Seems to be a quirk of Consul, if you pass -proxy-id is uses ingress-gateway as the envoy cluster name, otherwise the service name

Copy link
Member

Choose a reason for hiding this comment

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

Do we know if it's a bug or deliberate? Seems like it'd run into collisions too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looked closer, it's because it can namespace on id now, e.g.

  "node": {
    "cluster": "ingress-gateway",
    "id": "_nomad-task-85e65316-c6f9-44ba-3bc1-ea8cd2dfd493-group-ingress-group-my-ingress-service-8080",
    "metadata": {
      "namespace": "default",
      "envoy_version": "1.16.0"
    }
  },

Copy link
Member Author

Choose a reason for hiding this comment

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

Guess I should add that to the test

@vercel vercel bot temporarily deployed to Preview – nomad January 20, 2021 15:21 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 20, 2021 15:21 Inactive
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -516,7 +518,7 @@ func TestTaskRunner_EnvoyBootstrapHook_gateway_ok(t *testing.T) {

// the only interesting thing on bootstrap is the presence of the cluster,
// everything is configured at runtime through xDS
require.Equal(t, "my-ingress-service", out.Node.Cluster)
require.Equal(t, "ingress-gateway", out.Node.Cluster)
Copy link
Member

Choose a reason for hiding this comment

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

Do we know if it's a bug or deliberate? Seems like it'd run into collisions too.

@vercel vercel bot temporarily deployed to Preview – nomad January 20, 2021 15:48 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 20, 2021 15:48 Inactive
Co-authored-by: Tim Gross <tgross@hashicorp.com>
@vercel vercel bot temporarily deployed to Preview – nomad-storybook-and-ui January 20, 2021 15:51 Inactive
@vercel vercel bot temporarily deployed to Preview – nomad January 20, 2021 15:51 Inactive
@shoenig shoenig merged commit 42aa0c3 into master Jan 20, 2021
@shoenig shoenig deleted the b-cc-ig-id branch January 20, 2021 16:08
@tgross tgross added the hcc/cst Admin - internal label Jan 26, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hcc/cst Admin - internal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set proxy-id when bootstrapping gateway
3 participants