Declaring Task specific Volumes vs Workspaces #2680
Labels
kind/design
Categorizes issue or PR as related to design.
kind/documentation
Categorizes issue or PR as related to documentation.
Expected Behavior
That Tasks are reusable — independent of runtime environment
Actual Behavior
I proposed an alternative
git-clone
Task with more "Kubernetes native" use of Secrets in tektoncd/catalog#309 — mounting Secrets from aProjected
volume.There is also a
git-clone
Task example in #2642 that is using secrets from Azure Key Vault with examples — using Secrets mounted from aPersistentVolumeClaim
volume.The two examples above are almost an identical Task - but is mounting Secrets from different types of volumes. This shows that a volume really is a runtime consideration - and we usually declare runtime considerations in
PipelineRun
andTaskRun
.Volumes, may be mounted to Tasks in a Pipeline using a workspace. Tasks may also mount volumes individually.
Nature of Workspaces
I see workspaces as volumes to share files between Tasks. It is a very useful abstraction since many tasks in a CI-pipeline typically is file-operations.
Volumes specific to a Task
The above two Tasks shows examples of "private" volume-mounts. It would be more natural to declare these volumes - as a runtime consideration - but specific for the Task.
It is possible to declare a workspace intended for a specific Task in a PipelineRun, but that workspace must be carefully mapped in the correct PipelineTask by workspace name. With #2389 there is an alternative way to declare a volume specific Task in a PipelineRun - proposed in #2362. This is an implemented feature that we probably should use and document for these cases. I also may revert my #2601 (not in any release yet).
An example of setting Volume for a specific PipelineTask using the TaskRunSpec:
/kind design
/kind documentation
The text was updated successfully, but these errors were encountered: