Using volume claim templates
Instead of specifying a persistent volume claim directly, you can also ask Tekton to create a temporary one for you. This can be useful when you don't need to persist data outside of your pipelines. As an additional benefit, using a volume claim template enables you to run multiple pipeline runs concurrently. To use a volumeClaimTemplate
, you will need to write a new pipeline run. This time, you will add the pipelineSpec
, which is a way to define your entire pipeline without relying on a separate pipeline object:
- Start with a new file called
pvc-template.yaml
. In there, create a newPipelineRun
object:apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: clone-and-ls-pr-
- In the
spec
field of the pipeline run, add apipelineSpec
field containing aworkspaces
list with one workspace calledcodebase
:spec: pipelineSpec: workspaces: ...