-
Notifications
You must be signed in to change notification settings - Fork 923
docs: add new organizations docs to best practices section #15732
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
87273ca
init orgs bp
23bb13c
add copy to orgs bp
adab77e
add orgs diagram
d895af6
image
42bb1aa
use # for consistency
bdce887
Apply suggestions from code review
EdwardAngert 05f12a4
make fmt; update diagram
EdwardAngert 0d861e9
remove duplicate text
EdwardAngert 03bc126
add linux.die.net/man to linkspector ignore
EdwardAngert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# Organizations - best practices | ||
|
||
December 9, 2024 | ||
|
||
--- | ||
|
||
Coder [Organizations](../../admin/users/organizations.md) allow administrators | ||
finer control over groups, templates, workspaces, and provisioners within their | ||
Coder deployment. | ||
|
||
Organizations allow multiple platform teams to offer templates and | ||
infrastructure to their users instead of having them entirely managed in a | ||
centralized fashion. | ||
|
||
Each organization can have its own unique admin and users can belong to multiple | ||
organizations, but every organization must have separate templates, | ||
provisioners, groups, and workspaces. | ||
|
||
On this best practice page, we cover some of the ways you can use Organizations | ||
to make it easier to manage your groups smoothly. | ||
|
||
## How Coder organizations work | ||
|
||
Organizations are the hierarchical parent for templates, groups, and | ||
provisioners. Every new organization must have separate templates, provisioners, | ||
and groups. | ||
|
||
 | ||
|
||
Users can belong to multiple organizations while templates and provisioners | ||
cannot. | ||
|
||
## When to use organizations | ||
|
||
Organizations increase the maintenance overhead of a Coder deployment, so we | ||
recommend that you only use them when necessary. | ||
|
||
Use organizations when a separate group of users needs to manage their own | ||
templates and underlying infrastructure. If a group of users already has a | ||
separate, functional platform team willing to write templates or manage | ||
clusters, organizations may be a good fit. | ||
|
||
### Organization use case examples | ||
|
||
Here are a few examples for a fictional organization called MegaCo. It is | ||
deployed with Coder and has 1000 users in production. Today, MegaCo has a single | ||
(default) organization and a central platform team but is evaluating whether to | ||
use organizations for several use cases. | ||
|
||
| **Use Case** | **Description** | **Good fit for organizations?** | | ||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | ||
| Mergers and acquisitions | Raptix, a 180-person startup recently acquired by MegaCo, has an independent cloud account, platform team, and Terraform modules and pipelines for deploying their code. They want to use Coder. | ✅ Organizations | | ||
| Independent cloud-native teams that manage their namespaces, images, and/or clusters | MegaCo has six teams responsible for their own dev, staging, and production Kubernetes clusters and frequently deploy & test their work with `kubectl` and `helm`.</br></br>They wish to hook up Coder to their cluster so they can write and manage IDE templates for connecting to the cluster with their IDE | ✅ Organizations | | ||
| Java monolith | MegaCo has identified that anyone developing the Java monolith is best served with a VM instead of a container/cloud-native environment.</br></br>However, the Java team is supported by MegaCo's central platform team. | ❌ Use instead:</br>A separate template and/or groups | | ||
| Off-shore contractors | MegaCo employs off-shore contractors but has not onboarded them onto Coder due to privacy concerns, data sovereignty rules, and latency considerations.</br></br>They considered a minimal, localized second deployment of Coder, but decided against it due to maintenance overhead. | ✅ Organizations + Workspace Proxies | | ||
| Dev teams | Dev teams often need to bring their requirements for dev environments, such as specific repositories and tools | ❌ Use instead:</br>Parameters, dev containers, and/or groups | | ||
| ML Platform Team & ML Developers | MegaCo's data platform team maintains a homegrown "MLBox" product for data environments with a GPU, Jupyter, etc.</br></br>This team is interested in migrating to Coder for improved cost-saving and auditing of environments, but they need to hook up their own cluster and cloud accounts. They also want their templates only to be accessible to a specific set of users. | ✅ Organizations | | ||
| Supporting developers in various regions | MegaCo's central platform team supports developers connecting from the East Coast, the West Coast, and Australia. These developers are working on the same projects but need low-latency access to their environments. | ❌ Use instead:</br>Provisioners and workspace proxies to support multiple regions on a single template | | ||
|
||
## How to migrate to organizations | ||
|
||
Since templates and workspaces cannot be moved nor can they belong to multiple | ||
organizations, we recommend that you deprecate your template | ||
[through the API](../../reference/api/templates.md#update-template-metadata-by-id) | ||
or [through the Coder CLI](../../reference/cli/templates_edit.md#--deprecated). | ||
When a template is deprecated, the admin prevents new workspaces from being | ||
created and developers are notified with a deprecation message which can link to | ||
an external wiki page on migration instructions. | ||
|
||
Users can use a file transfer tool such as | ||
[rsync](https://linux.die.net/man/1/rsync) to migrate their files from one | ||
workspace to another. | ||
|
||
## Provisioner Isolation and Zero Trust | ||
|
||
In the organizations model, provisioners run in a separate | ||
cluster/infrastructure and have an isolated key to authenticate back with Coder. | ||
The provisioners have access to separate cloud resources that the control plane | ||
cannot access. Instead, the control plane sends simple "provisioner jobs" to the | ||
provisioner and the provisioner is responsible for executing the Terraform. | ||
|
||
There are planned improvements to the troubleshooting provisioners process. | ||
Follow these GitHub issues for more details: | ||
|
||
- [coder/coder#15048](https://github.com/coder/coder/issues/15048) | ||
- [coder/coder#15087](https://github.com/coder/coder/issues/15087) | ||
- [coder/coder#15192](https://github.com/coder/coder/issues/15192) | ||
|
||
## Identity Provider (SSO) Sync | ||
|
||
While the Coder UI or API can be used to assign specific users to organizations, | ||
this is discouraged. Instead, we recommend syncing the state from your identity | ||
provider such as Okta. A single claim from the identity provider (like | ||
`memberOf`) can be used to sync site-wide roles, organizations, groups, and | ||
organization roles. | ||
|
||
### Planned enhancements | ||
|
||
Site-wide role sync is managed via server flags. We plan on changing this to | ||
runtime configuration so Coder does not need a re-deploy: | ||
|
||
- Issue [coder/internal#86](https://github.com/coder/internal/issues/86) | ||
|
||
Make all sync configurable via the dashboard UI: | ||
|
||
- [coder/coder#15290](https://github.com/coder/coder/issues/15290) | ||
|
||
Regex filters and mapping can be configured to ensure the proper resources are | ||
allocated in Coder. Learn more about [IDP sync](../../admin/users/idp-sync.md). | ||
|
||
## Custom Roles | ||
|
||
Custom roles are organization-scoped and can be used to limit access controls | ||
within an organization. Custom roles can be applied to the default organization. | ||
|
||
Some examples of custom roles that can be created: | ||
|
||
**Provisioner Admin** | ||
|
||
- The user can deploy provisioners but not manage templates. This may be useful | ||
if automation is used to create and update templates in the organization. | ||
|
||
**Template Editor** | ||
|
||
- Inverse of provisioner admin: User can manage templates but not deploy | ||
provisioners. This may be useful if the provisioner and template are deployed | ||
via automation and users are allowed to edit them. | ||
|
||
**Template Pusher** | ||
|
||
- A system account that can push new templates from a git repo but cannot manage | ||
users or delete templates. | ||
|
||
We’re interested in identifying new use cases for custom roles. Please | ||
[create a GitHub issue](https://github.com/coder/internal/issues/new?title=request%28orgs%29%3A+request+title+here&labels=["customer-feedback"]&body=please+enter+your+request+here) | ||
with your suggestion or request. | ||
|
||
## Managing Organizations at Scale | ||
|
||
Using ClickOps to onboard new organizations, set quotas, and SSO sync can be | ||
cumbersome, especially if you want to "seed" organizations with provisioners and | ||
starter templates. | ||
|
||
Support for managing Organizations via the coderd Terrafom provider is planned | ||
so that this can be done declaratively and bulk updates to things like templates | ||
and quotas can be performed easily: | ||
|
||
- Issue | ||
[coder/terraform-provider-coderd#39](https://github.com/coder/terraform-provider-coderd/issues/39) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.