Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit ac6205e

Browse files
authored
Add docs for nodeSelector and tolerations (#398)
1 parent 0b23dea commit ac6205e

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

workspaces/workspaces-as-code/templates.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ labels:
152152
com.coder.custom.world: world
153153
```
154154

155+
`labels` is disabled by default and must be enabled by a site admin.
156+
155157
#### workspace.specs.kubernetes.gpu-count.value
156158

157159
The number of GPUs to allocate to the workspace.
@@ -173,6 +175,52 @@ Determines whether the workspace should be created as a
173175

174176
**Required**. The amount of disk space (in GB) to allocate to the workspace.
175177

178+
#### workspace.specs.kubernetes.tolerations.value
179+
180+
Adds [Kubernetes
181+
tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
182+
to the workspace pod.
183+
184+
```yaml
185+
tolerations:
186+
value:
187+
- key: example1
188+
operator: Exists
189+
value: value-1
190+
effect: NoSchedule
191+
tolerationSeconds: 200
192+
- key: example-3
193+
operator: Equal
194+
value: value-2
195+
effect: PreferNoSchedule
196+
tolerationSeconds: 400
197+
- key: example-3
198+
value: value-3
199+
effect: NoExecute
200+
```
201+
202+
`tolerations` is disabled by default and must be enabled by a site admin.
203+
204+
#### workspace.specs.kubernetes.node-selector.value
205+
206+
Adds [Kubernetes
207+
NodeSelectors](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
208+
to the workspace pod. The value is a sequence of key/value pairs.
209+
210+
For example, the following snippet would add two `nodeSelectors` for Kubernetes:
211+
`accelerator:nvidia` and `disktype:ssd`.
212+
213+
```yaml
214+
node-selector:
215+
value:
216+
- key: accelerator
217+
value: nvidia
218+
- key: disktype
219+
value: ssd
220+
```
221+
222+
`node-selector` is disabled by default and must be enabled by a site admin.
223+
176224
#### workspace.configure
177225

178226
This section lists the commands that run within the workspace after Coder builds

0 commit comments

Comments
 (0)