Thanks to visit codestin.com
Credit goes to github.com

Skip to content

enhance workspacesdk to start a tailnet that connects to all user's workspaces #14730

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

Closed
spikecurtis opened this issue Sep 19, 2024 · 0 comments · Fixed by #15534
Closed

enhance workspacesdk to start a tailnet that connects to all user's workspaces #14730

spikecurtis opened this issue Sep 19, 2024 · 0 comments · Fixed by #15534
Assignees
Labels
networking Area: networking

Comments

@spikecurtis
Copy link
Contributor

The existing workspacesdk API allows connecting to a single workspace Agent. We need to add a new API call that creates a tailnet connected to every started agent in workspaces owned by the user.

To do this, we

  1. Use the new HTTP endpoint and WorkspaceUpdates RPC to track all the workspaces and agents (Add new WorkspaceUpdates tailnet RPC #14716)
  2. Program the agents into the tailnet using the enhanced support for multiple peers (enhance tailnetAPIConnector to support multiple peers #14729)
  3. Program DNS records for the peers (Enhance tailnet to (optionally) configure DNS records for peers. #14718)

DNS naming scheme:

  • <agent>.<workspace>.<user>.coder
    • <agent>.<workspace>.me.coder - works with me as an alias for the logged in user
  • <workspace>.coder - alias that assumes me and that the workspace has only one agent.
@spikecurtis spikecurtis added feature networking Area: networking labels Sep 19, 2024
@matifali matifali removed the feature label Oct 14, 2024
spikecurtis added a commit that referenced this issue Nov 14, 2024
re: #14730

Adds a protocol controller for WorkspaceUpdates RPC that takes all the agents we learn about over the RPC, and programs them into the Coordination controller, so that we set up tunnels to all the agents.

Handling DNS is in a PR up the stack, as is actually wiring it up to anything.
spikecurtis added a commit that referenced this issue Nov 15, 2024
re: #14730

Adds support for the workspace updates protocol controller to also program DNS names for each agent.

Right now, we only program names like `myagent.myworkspace.me.coder` and `myworkspace.coder.` (if there is exactly one agent in the workspace).  We also want to support `myagent.myworkspace.username.coder.`, but for that we need to update WorkspaceUpdates RPC to also send the workspace owner's username, which will be in a separate PR.
spikecurtis added a commit that referenced this issue Nov 18, 2024
re: #14730

Adds support in `tailnet.Controller` for WorkspaceUpdates.

Also checks configured controllers against the clients returned by the dialer, so that if we connect with a dialer that doesn't support an RPC (for instance the in-memory dialer for ServerTailnet doesn't support WorkspaceUpdates), we throw an error if there is a controller expecting it.
spikecurtis added a commit that referenced this issue Nov 18, 2024
closes #14730

Adds support for WorkspaceUpdates to the WebsocketDialer. This allows us to dial the new endpoint added in #14847 and connect it up to a `tailnet.Controllers` to connect to all agents over the tailnet.

I refactored the fakeWorkspaceUpdatesProvider to a mock and moved it to `tailnettest` so it could be more easily reused.  The Mock is a little more full-featured.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking Area: networking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants