Overview
Advanced workspace features include:- Using subpaths to organize workspace data
- Isolating workspace access to specific Steps
- Optional workspaces with conditional logic
- Sharing workspaces across Pipeline Tasks
- Dynamic workspace configuration
Workspace Subpaths
Subpaths allow multiple Tasks to use different directories within the same workspace:Basic Subpath Usage
Parameterized Subpaths
Use parameters to dynamically configure subpaths:Isolated Workspaces
Limit workspace access to specific Steps within a Task:By default, workspaces are mounted to all Steps. Use the
workspaces field in a Step to override the default mount path or isolate access.Optional Workspaces
Make workspaces optional and handle their presence conditionally:Workspace Bound Variable
Check if an optional workspace was provided:Workspace Propagation
Share a Pipeline workspace across multiple Tasks:Each Task can map the Pipeline workspace to a different workspace name within the Task.
Workspace Types
PersistentVolumeClaim
Use existing PVC:ConfigMap
Secret
EmptyDir
CSI Volumes
Workspace Variables
Access workspace metadata in your Tasks:Advanced Patterns
Cache Workspace Pattern
Multi-Environment Pattern
Temporary Workspace for Build Artifacts
Best Practices
Use VolumeClaimTemplates for Dynamic Storage
Organize with Subpaths
Clean Up After Use
Use Optional Workspaces for Flexibility
Validate Workspace Contents
When should I use subpaths vs separate workspaces?
When should I use subpaths vs separate workspaces?
Use subpaths when:
- Multiple Tasks need to share a single PVC
- You want to organize data hierarchically
- You need to reduce PVC costs
- Tasks write to different directories
- Data has different lifecycle requirements
- You need different access modes (ReadOnly vs ReadWrite)
- Tasks require isolation for security
- Different storage classes are needed
How do I debug workspace issues?
How do I debug workspace issues?
Common debugging steps:
- Check workspace is bound:
- List workspace contents:
- Check permissions:
- Verify PVC: