-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document how PVC access modes affect pipeline execution
The access mode configured for a PVC that is used as a workspace volume source may affect how a pipeline is executed, this is not well documented. This commit intend to improve the documentation about this and also provide an example on how to run parallel tasks when using PVC with ReadWriteOnce access mode. - Document how access mode affect task ordering in pipeline under "Specifying Workspace order in a Pipeline" - Provide a full pipeline example of how to use parallel tasks when using a PVC with access mode ReadWriteOnce - We we did provide a "PipelineRun example" under "Example PipelineRun definitions using Workspaces". This commit provide a full PipelineRun example using a workspace. Instead of providing examples of different volume sources here, examples on how to use different VolumeSources is moved to "Specifying VolumeSources in Workspaces" - The VolumeSources persistentVolumeClaim and volumeClaimTemplate both is a PVC, and PVCs has its own peculiarities, e.g. access mode that we document. Both PVC volume sources is moved to a section so we can document the common peculiarities in a single place - Add the workspace variable introduced in #2506
- Loading branch information
1 parent
ff29782
commit 7bbc7eb
Showing
3 changed files
with
178 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
examples/v1beta1/pipelineruns/pipelinerun-with-parallel-tasks-using-pvc.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: write-to-file | ||
spec: | ||
steps: | ||
- name: write | ||
image: ubuntu | ||
script: echo bar > $(workspaces.task-ws.path)/foo | ||
workspaces: | ||
- name: task-ws | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: read-two | ||
spec: | ||
workspaces: | ||
- name: ws-a | ||
- name: ws-b | ||
steps: | ||
- name: read-1 | ||
image: ubuntu | ||
script: cat $(workspaces.ws-a.path)/foo | grep bar | ||
- name: read-2 | ||
image: ubuntu | ||
script: cat $(workspaces.ws-b.path)/foo | grep bar | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: pipeline-using-parallel-tasks | ||
spec: | ||
workspaces: | ||
- name: ws-track-a | ||
- name: ws-track-b | ||
tasks: | ||
- name: parallel-writer-a | ||
taskRef: | ||
name: write-to-file | ||
workspaces: | ||
- name: task-ws | ||
workspace: ws-track-a | ||
- name: parallel-writer-b | ||
taskRef: | ||
name: write-to-file | ||
workspaces: | ||
- name: task-ws | ||
workspace: ws-track-b | ||
- name: read-all | ||
runAfter: | ||
- parallel-writer-a | ||
- parallel-writer-b | ||
taskRef: | ||
name: read-two | ||
workspaces: | ||
- name: ws-a | ||
workspace: ws-track-a | ||
- name: ws-b | ||
workspace: ws-track-b | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: pr- | ||
spec: | ||
pipelineRef: | ||
name: pipeline-using-parallel-tasks | ||
workspaces: | ||
- name: ws-track-a | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
- name: ws-track-b | ||
volumeClaimTemplate: | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |