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

Unix Domain Socket support for upstreams and downstreams #9981

Merged
merged 7 commits into from
May 4, 2021

Conversation

markan
Copy link
Contributor

@markan markan commented Apr 7, 2021

This implements support for Unix Domain Sockets in for upstream and downstream sockets. This is the first working pass.

  • Need end to end tests
  • Need further test coverage for rendering clusters and endpoints
  • Some further thought needs to happen around the proliferation of {Address|Port|Socket} variables and perhaps they should be unified.
  • Rebase/squashing required

@markan markan added the theme/connect Anything related to Consul Connect, Service Mesh, Side Car Proxies label Apr 7, 2021
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging April 12, 2021 23:55 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging April 13, 2021 17:37 Inactive
@vercel vercel bot temporarily deployed to Preview – consul April 14, 2021 01:47 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging April 14, 2021 01:47 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging April 14, 2021 02:28 Inactive
@vercel vercel bot temporarily deployed to Preview – consul April 14, 2021 02:28 Inactive
@markan markan added this to the 1.10.0 milestone Apr 15, 2021
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging April 27, 2021 04:09 Inactive
@vercel vercel bot temporarily deployed to Preview – consul April 27, 2021 04:09 Inactive
@markan markan marked this pull request as ready for review April 27, 2021 04:17
agent/config/config.go Outdated Show resolved Hide resolved
agent/config/builder.go Outdated Show resolved Hide resolved
agent/proxycfg/manager.go Outdated Show resolved Hide resolved
agent/proxycfg/state.go Outdated Show resolved Hide resolved
agent/structs/structs.go Outdated Show resolved Hide resolved
agent/structs/structs.go Outdated Show resolved Hide resolved
agent/xds/listeners.go Outdated Show resolved Hide resolved
agent/xds/endpoints.go Outdated Show resolved Hide resolved
@@ -470,6 +482,21 @@ func makeLoadAssignment(clusterName string, endpointGroups []loadAssignmentEndpo
return cla
}

// This could be take Service instead of CheckServiceNode
Copy link
Member

Choose a reason for hiding this comment

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

Probably not, since it uses the BestAddress function?

@markan markan changed the title Ma/uds upstreams Unix Domain Socket support for upstreams and downstreams May 3, 2021
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 4, 2021 05:35 Inactive
@vercel vercel bot temporarily deployed to Preview – consul May 4, 2021 05:35 Inactive
agent/config/builder.go Outdated Show resolved Hide resolved
agent/config/config.go Outdated Show resolved Hide resolved
agent/proxycfg/state.go Outdated Show resolved Hide resolved
agent/proxycfg/testing.go Outdated Show resolved Hide resolved
agent/structs/connect_proxy_config.go Outdated Show resolved Hide resolved
agent/structs/structs.go Outdated Show resolved Hide resolved
agent/structs/testing_connect_proxy_config.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – consul May 4, 2021 18:06 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 4, 2021 18:06 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 4, 2021 19:10 Inactive
@vercel vercel bot temporarily deployed to Preview – consul May 4, 2021 19:10 Inactive
Copy link
Contributor

@freddygv freddygv left a comment

Choose a reason for hiding this comment

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

LGTM, nice work!

markan added 7 commits May 4, 2021 12:41
Start making structure changes to support unix domain socket address for upstreams

	upstreams = [
	  {
	    destination_name = "echo-service"
	    local_bind_socket_path = "/tmp/upstream.sock"
	    config {
	      passive_health_check {
		interval = "10s"
		max_failures = 42
	      }
	    }
	  }

Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Rework/listeners, rename makeListener

Refactor, tests pass

Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Enhance config by adding SocketPath and LocalSocketPath config values

Supports syntax of the form:
```
services {
  name = "sock_forwarder"
  id = "sock_forwarder.1"
  socket_path = "/tmp/downstream_3.sock"
  connect {
    sidecar_service {
      proxy {
	local_service_socket_path = "/tmp/downstream.sock"
      }
    }
  }
}
```

Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging May 4, 2021 19:43 Inactive
@vercel vercel bot temporarily deployed to Preview – consul May 4, 2021 19:43 Inactive
@markan markan merged commit b9f8a8f into master May 4, 2021
@markan markan deleted the ma/uds_upstreams branch May 4, 2021 19:54
mikemorris pushed a commit that referenced this pull request May 5, 2021
Unix Domain Socket support for upstreams and downstreams
mikemorris pushed a commit that referenced this pull request May 5, 2021
Unix Domain Socket support for upstreams and downstreams
johncowen added a commit that referenced this pull request May 26, 2021
This commit adds UI support for Unix Domain Sockets for upstream and downstreams (see #9981 and #10252)
hc-github-team-consul-core pushed a commit that referenced this pull request May 26, 2021
This commit adds UI support for Unix Domain Sockets for upstream and downstreams (see #9981 and #10252)
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.

None yet

3 participants