Using workspaces in pipeline runs
As part of your pipeline definition, you cannot add a workspace the same way you could add default values to your parameters. If you want Tekton to start your pipeline automatically with the appropriate persistent volume claim, you will need to create a pipeline run:
- Start with a new file called
pipelinerun.yaml
. In there, create an object of kindPipelineRun
. Like what you did with task runs, this object will have agenerateName
field instead of an actual name:apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: generateName: clone-and-ls-pr- spec:
- This pipeline run will use the pipeline that you just built called
clone-and-list
:pipelineRef: name: clone-and-list
- Finally, add a workspace named
codebase
. This workspace uses a persistent volume claim, and theclaimName
istekton-pvc
:workspaces: - name: codebase persistentVolumeClaim...