-
Notifications
You must be signed in to change notification settings - Fork 887
cli: support multiple deployments with coder deployment use
#13325
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
Comments
cc @bpmct |
We should not add multiple top-level commands for this bespoke feature. It will bloat the help. |
Good call, fixed. |
coder use-deployment
coder deployment use
For more context on extensions, since you can be connected to any workspace on any deployment at any time, and the connections are essentially stored as host names, it means we need them all in the SSH config at once and not just the last configured workspace like the Coder CLI currently does. So in the JetBrains plugin we have blocks like this:
When you connect, it stores (One issue with But, this becomes tricky if we want to support the shorter Maybe we just output both?
And the shorter Maybe we use a But there could be a smarter way of doing all this. 🤔 Edit: I wish we could just have separate SSH configs for each deployment but in JetBrains at least there does not seem to be any way to configure the SSH config file path. |
That screenshot provides some great context, thanks @MrPeacockNLB. @code-asher I think I see how just storing deployment URL+session_token doesn't really help with the ssh config resolution. So I'm understanding correctly, if I use Gateway to access workspaces on two different coder deployments, are all my workspaces visible in the extension at all times? I think it would be ideal if that were the case for both extensions. Meanwhile If we put both the verbose and implicit hosts in in the ssh config, could we support the above behavior? The screenshot above shows something else I didn't consider which is copying the binary. IE I have a What do we think about
We could also define these in a |
From the "Connect to Coder" button, only the workspaces from the current deployment are visible. From the "Recent Projects" screen (from the sidebar) all projects that have been connected to in the past are visible, from any deployment. But, there is no place currently that shows all workspaces for all deployments, although we could add this. The multiple deployment thing at the moment really only exists to support reopening previous workspaces that might belong to a different deployment than the current one.
Yup I think so.
I like this, this is pretty much what the JetBrains plugin does, minus the symlink. A directory for each deployment with the config and binary for that deployment. |
@code-asher, is this still in your backlog? We may postpone it until we can consider the organization context in the CLI. |
No, it is not in my backlog at the moment. Still interested in implementing though once the dust settles. |
closing in favor #9857. |
We don't currently support multiple deployments in the CLI, right now we only store one session token and one URL. We should allow the user to store multiple on each
coder login
call and have some state that points to the "active" deployment. Effectively we'd like to emulatekubectl
contexts.This hasn't been explicitly requested, but simplifies supporting multiple deployments in extensions and prepares for ongoing RBAC work.
We could achieve this with a very simple
coder.yaml
ordeployments.yaml
.I'd propose that each "coder context" or simply "coder deployment" be keyed by the deployment url:
Or
Edit: changed syntax to avoid top-level commands.
The text was updated successfully, but these errors were encountered: