You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve documentation about volumeClaimTemplate workspaces
Add a short example and link to a full example of using volumeClaimTemplate
as a volume source in a workspace.
Requested in comment to PR #2326 (comment)
that
fixes#1986
Copy file name to clipboardExpand all lines: docs/workspaces.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,6 +256,20 @@ The entry must also include one `VolumeSource`. See [Using `VolumeSources` with
256
256
The examples below illustrate how to specify `Workspaces` in your `PipelineRuns`. For a more in-depth example, see the
257
257
[`Workspaces` in `PipelineRun`](../examples/v1beta1/pipelineruns/workspaces.yaml) YAML sample.
258
258
259
+
In the example below, a template is provided for how a `PersistentVolumeClaim` should be created for a workspace named `myworkspace` declared in a `Pipeline`. When using `volumeClaimTemplate` a new `PersistentVolumeClaim` is created for each `PipelineRun` and it allows the user to specify e.g. size and StorageClass for the volume.
260
+
261
+
```yaml
262
+
workspaces:
263
+
- name: myworkspace
264
+
volumeClaimTemplate:
265
+
spec:
266
+
accessModes:
267
+
- ReadWriteOnce
268
+
resources:
269
+
requests:
270
+
storage: 1Gi
271
+
```
272
+
259
273
In the example below, an existing `PersistentVolumeClaim` named `mypvc` is used for a `Workspace`
260
274
named `myworkspace` declared in a `Pipeline`. It exposes only the subdirectory `my-subdir` from that `PersistentVolumeClaim`:
261
275
@@ -307,7 +321,7 @@ The `persistentVolumeClaim` field references an existing [`persistentVolumeClaim
307
321
308
322
The `volumeClaimTemplate` is a template of a [`persistentVolumeClaim` volume](https://kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim), created for each `PipelineRun` or `TaskRun`.
309
323
When the volume is created from a template in a `PipelineRun` or `TaskRun` it will be deleted when the `PipelineRun` or `TaskRun` is deleted.
310
-
`volumeClaimTemplate`volumes are a good choice for sharing data among `Tasks` within a `Pipeline` when the volume is only used during a `PipelineRun` or `TaskRun`.
324
+
`volumeClaimTemplate`volumes are a good choice for sharing data among `Tasks` within a `Pipeline` when the volume is only used during a `PipelineRun` or `TaskRun`. See [`Workspaces` from a volumeClaimTemplate in a `PipelineRun`](../examples/v1beta1/pipelineruns/workspace-from-volumeclaimtemplate.yaml) for a complete example.
311
325
312
326
#### `configMap`
313
327
@@ -336,3 +350,4 @@ See the following in-depth examples of configuring `Workspaces`:
336
350
337
351
- [`Workspaces` in a `TaskRun`](../examples/v1beta1/taskruns/workspace.yaml)
338
352
- [`Workspaces` in a `PipelineRun`](../examples/v1beta1/pipelineruns/workspaces.yaml)
353
+
- [`Workspaces` from a volumeClaimTemplate in a `PipelineRun`](../examples/v1beta1/pipelineruns/workspace-from-volumeclaimtemplate.yaml)
0 commit comments