Skip to content

Commit fc48d53

Browse files
committed
add best practices and variables
1 parent 57d4d0f commit fc48d53

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

docs/concepts.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,70 @@
22

33
## Templates
44

5-
Coder admins manage *templates* to define the infrastructure behind workspaces. A Coder deployment can have multiple templates for different workloads.
5+
Coder admins manage *templates* to define the infrastructure behind workspaces. A Coder deployment can have templates for different workloads.
66

77
### ex. "Frontend" Template
88

9-
| Resource name | Status |
9+
| Resource | Type |
1010
| :---------------------- | :--------- |
1111
| Kubernetes pod (NodeJS) | ephemeral |
1212
| API token (Backend) | ephemeral |
1313
| Disk (Source code) | persistant |
1414

1515
### ex. "Data Science" Template
1616

17-
| Resource name | Status |
17+
| Resource | Type |
1818
| :------------------------------------- | :--------- |
1919
| Kubernetes pod (pyCharm + JupyterLab) | ephemeral |
2020
| Readonly volume mount (shared dataset) | persistant |
2121

2222
### ex. "MacOS" Template
2323

24-
| Resource name | Status |
24+
| Resource | Type |
2525
| :----------------- | :--------- |
2626
| MacOS VM | ephemeral |
2727
| Disk (source code) | persistant |
2828

2929
### ex. "Linux Debugging" Template
3030

31-
| Resource name | Status |
31+
| Resource | Type |
3232
| :----------------------- | :--------- |
3333
| EC2 VM (Debian 11.3 AMI) | persistant |
3434

35-
### Templates are managed via the CLI
35+
### Ephemeral vs persistant
36+
37+
Coder supports ephemeral and persistant resources in workspaces. Ephemeral resources will be destroyed when a workspace is stopped/not in use. Persistant resources are not.
38+
39+
When a workspace is deleted, all resources are destroyed.
40+
41+
### Managing templates
3642

3743
Admins can use Coder's production-ready examples, or create/modify templates with standard Terraform.
3844

3945
```sh
40-
# start from an example template
46+
# start from an example
4147
coder templates init
4248

43-
# optional: modify the template
49+
# optional: modify the template
4450
vim <template-name>/main.tf
4551

46-
# add the template to Coder
52+
# add the template to Coder deployment
4753
coder templates <create/update> <template-name>
4854
```
4955

50-
## Workspaces
56+
If you are commonly editing templates, we recommend source-controlling template code using GitOps/CI pipelines to make changes.
5157

52-
Coder users create *workspaces* to get a remote development environment. Depending on the template,
58+
### Variables
5359

60+
Templates often contain *variables*. In Coder, there are two types of variables.
5461

62+
**Admin variables** are set when a template is being created/updated. These are often cloud secrets, such as a ServiceAccount token. These are annotated with `sensitive = true` in the template code.
63+
64+
**User variables** are set when a user creates a workspace. They are unique to each workspace, often personalization settings such as preferred region or workspace image.
65+
66+
## Workspaces
67+
68+
Coder users create *workspaces* to get a remote development environment. Depending on the template,
5569

70+
### Supported IDEs
5671

0 commit comments

Comments
 (0)