From a7a4c5da019d630fd0ef7e570369bb4ef218104d Mon Sep 17 00:00:00 2001 From: Jonas Pettersson Date: Tue, 28 Apr 2020 14:34:51 +0200 Subject: [PATCH] Also document volumeClaimTemplate for TaskRun The volumeClaimTemplate workspace is only documented for PipelineRun. This commit adds documentation of volumeClaimTemplate also for TaskRun. --- README.md | 2 +- docs/workspaces.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 51e2c8e13dd..9846e7a89ca 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Tekton Pipelines are **Typed**: - Jump in with [the tutorial!](docs/tutorial.md) - Take a look at our [roadmap](roadmap.md) -*Note that starting from the 0.11 release of Tetkon, you need to have +*Note that starting from the 0.11 release of Tekton, you need to have a cluster with **Kubernetes version 1.15 or later***. ### Read the docs diff --git a/docs/workspaces.md b/docs/workspaces.md index 54b24ee31fa..422f422650b 100644 --- a/docs/workspaces.md +++ b/docs/workspaces.md @@ -142,6 +142,20 @@ The entry must also include one `VolumeSource`. See [Using `VolumeSources` with The following examples illustrate how to specify `Workspaces` in your `TaskRun` definition. For a more in-depth example, see [`Workspaces` in a `TaskRun`](../examples/v1beta1/taskruns/workspace.yaml). +In the example below, a template is provided for how a `PersistentVolumeClaim` should be created for a Task's workspace named `myworkspace`. When using `volumeClaimTemplate` a new `PersistentVolumeClaim` is created for each `TaskRun` and it allows the user to specify e.g. size and StorageClass for the volume. + +```yaml +workspaces: +- name: myworkspace + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +``` + In the example below, an existing `PersistentVolumeClaim` called `mypvc` is used for a Task's `workspace` called `myworkspace`. It exposes only the subdirectory `my-subdir` from that `PersistentVolumeClaim`: