Skip to content

Commit 60da934

Browse files
bpmctKatie Horne
and
Katie Horne
authored
add detail to site-wide template policy doc (coder#426)
* mention fields * document custom workspaces and conflict behavior * change formatting now matches "dev urls - access control" section * Edit text Co-authored-by: Katie Horne <katie@coder.com>
1 parent fba9d5e commit 60da934

File tree

1 file changed

+49
-37
lines changed

1 file changed

+49
-37
lines changed

admin/templates.md

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: Templates
3-
description:
4-
Learn how to create an embeddable "Open In Coder" button for your Workspaces
5-
As Code Template
3+
description: Learn how to manage your Workspaces as Code Templates.
64
---
75

86
The **Templates** tab features options that control the behavior of workspace
@@ -14,56 +12,70 @@ located in Git repositories.
1412

1513
![Enable workspace templates](../assets/enable-ws-templates.png)
1614

17-
## Template policy (alpha)
15+
## Template policy
16+
17+
> Template policies are currently an **alpha** feature.
1818
1919
If you enable the use of workspace templates, a **template policy** allows you
20-
to control which fields users can set and which values can be used when they
21-
define their workspaces.
20+
to control which fields users can set and which values can they can use when
21+
defining their workspaces.
22+
23+
Users can apply the following policies to fields:
24+
25+
- `read` - **Default.** Workspaces cannot modify the field
26+
- `write` - Workspaces can overwrite the field
27+
- `append` - Workspaces can append lists (e.g., configure.start steps) or
28+
mappings to the field
2229

2330
The default template policy is as follows:
2431

2532
```yaml
2633
version: "0.2"
2734
workspace:
28-
configure:
29-
start:
30-
policy: write
31-
dev-urls:
35+
configure:
36+
start:
37+
policy: write
38+
dev-urls:
39+
policy: write
40+
specs:
41+
kubernetes:
42+
container-based-vm:
43+
policy: write
44+
cpu:
45+
policy: write
46+
disk:
3247
policy: write
33-
specs:
34-
kubernetes:
35-
container-based-vm:
36-
policy: write
37-
cpu:
38-
policy: write
39-
disk:
40-
policy: write
41-
env:
42-
policy: write
43-
gpu-count:
44-
policy: write
45-
image:
46-
policy: write
47-
labels:
48-
policy: read
49-
memory:
50-
policy: write
51-
node-selector:
52-
policy: read
53-
tolerations:
54-
policy: read
48+
env:
49+
policy: write
50+
gpu-count:
51+
policy: write
52+
image:
53+
policy: write
54+
labels:
55+
policy: read
56+
memory:
57+
policy: write
58+
node-selector:
59+
policy: read
60+
tolerations:
61+
policy: read
5562
```
5663
57-
Underneath the policy template preview, you can either upload your policy or you
58-
can drag-and-drop the file onto the UI. Click **Save** to persist your changes.
64+
Underneath the policy template preview, you can either upload your policy or
65+
drag-and-drop the file onto the UI. Click **Save** to persist your changes.
5966
6067
If, at any time, you want to remove your policy and use Coder's default policy,
6168
click **Reset to default**.
6269
70+
The template policy applies to all workspaces, including custom workspaces,
71+
created and managed in Coder. If a workspace's properties conflict with the
72+
template policy, Coder will ignore the workspace's values in favor of those
73+
defined by the template policy.
74+
6375
## Embeddable Button
6476
65-
The Embeddable Button section features a form you can use for generating an embeddable
66-
button. This button makes it easy for developers to use your
77+
The **Embeddable Button** section features a form you can use for generating an
78+
embeddable button. This button makes it easy for developers to use your
6779
[workspace template](../workspaces/workspaces-as-code/index.md).
6880
6981
To create your button:
@@ -82,4 +94,4 @@ By default, workspaces as code is an opt-in feature. To enable workspaces as
8294
code, go to **Admin > Templates** and set **Enable using Workspace Templates**
8395
to **On**.
8496

85-
![toggle workspaces as code](../assets/admin/wac_toggle.png)
97+
![Toggle workspaces as code](../assets/wac_toggle.png)

0 commit comments

Comments
 (0)