Skip to content

Commit 361decc

Browse files
committed
update structrure
1 parent fc48d53 commit 361decc

File tree

3 files changed

+48
-75
lines changed

3 files changed

+48
-75
lines changed

docs/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ Some pages are coming soon. Contributions welcome!
7373
- [Why remote development](about.md#why-remote-development)
7474
- [Why Coder](about.md#why-coder)
7575
- [What Coder is not](about.md#what-coder-is-not)
76-
- Concepts
77-
- Templates
78-
- Workspaces
79-
- Users and Organizations
76+
- [Templates](./templates.md)
77+
- [Managing templates](./templates.md#managing-templates)
78+
- [Persistant and ephemeral resources](./templates.md#persistant-and-ephemeral-resources)
79+
- [Variables](./templates.md#variables)
80+
- Workspaces
81+
-
8082
- Guides
8183
- Using the Coder CLI
8284
- Install Coder on a VM with Caddy + LetsEncrypt

docs/concepts.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

docs/templates.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Templates
2+
3+
Coder admins manage *templates* to define the infrastructure behind workspaces. A Coder deployment can have templates for different workloads.
4+
5+
## Managing templates
6+
7+
Coder provides production-ready template [examples](../examples/), but they can be modified with Terraform.
8+
9+
```sh
10+
# start from an example
11+
coder templates init
12+
13+
# optional: modify the template
14+
vim <template-name>/main.tf
15+
16+
# add the template to Coder deployment
17+
coder templates <create/update> <template-name>
18+
```
19+
20+
If you are commonly editing templates, we recommend source-controlling template code using GitOps/CI pipelines to make changes.
21+
22+
## Persistant and ephemeral resources
23+
24+
Coder supports ephemeral and persistant resources in workspaces. Ephemeral resources are be destroyed when a workspace is not in use (stopped). Persistant resources remain. See how this works for an example "frontend" template:
25+
26+
| Resource | Type |
27+
| :--------------------------- | :--------- |
28+
| google_compute_disk.home_dir | persistent |
29+
| kubernetes_pod.dev | ephemeral |
30+
| └─ nodejs (linux, amd64) | |
31+
| api_token.backend | ephemeral |
32+
33+
When a workspace is deleted, all related resources are destroyed.
34+
35+
## Variables
36+
37+
Templates often contain *variables*. In Coder, there are two types of variables.
38+
39+
**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.
40+
41+
**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.
42+

0 commit comments

Comments
 (0)