triggers: Relax TriggerTemplate limitation of only creating Tekton resources

Expected Behavior

It should be possible to create a PersistentVolumeClaim resource in TriggerTemplate spec.resourcetemplates:.

Actual Behavior

Only Tekton resources are allowed.

Steps to Reproduce the Problem

We would like to have a possibilty to dynamically create a PVC within TriggerTemplate.

apiVersion: tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
 name: pipeline-tt
 namespace: awesome-pipelines
spec:
 params:
 - name: pipelineName
   description: Pipeline Name (build, deploy, verify)    
resourcetemplates:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: $(uid)
  spec:
    resources:
      requests:
        storage: 0.2Gi
    accessModes:
      - ReadWriteMany
 - apiVersion: tekton.dev/v1alpha1
   kind: PipelineRun
   metadata:
     generateName: pipeline-run-
   spec:
     serviceAccountName: pipeline-sa
     pipelineRef:
       name: pipeline-$(params.pipelineName)
     workspaces:
     - name: pipeline-workspace
       persistentVolumeClaim:
         claimName: `$(uid)`

We don’t think this will break any design decisions but can be very helpful in some dynamic scenarios.

In this context we really miss “support” for workspace lifecycle management. For example cleaning up a workspace (and optional PVC) after:

We also follow the Auto Workspaces discussion.

Additional Info

This issue has its roots here.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@disposab1e @vdemeester @vtereso I agree with you all! This is a blocker before using Tekton in a professional environment. I spent some time and submitted https://github.com/tektoncd/pipeline/pull/2326 for the solution I proposed in the auto workspace issue.

@jlpettersson Looks wonderful! I like the idea that the PVC is deleted when TaskRun, PipelineRun is deleted!

The use case mentioned in this issue is now possible using volumeClaimTemplate. I’m going to close this out now but we can re-open if any new use cases pop up that needs Triggers to create non-Tekton resources.

@vdemeester Perhaps it will be there? Still open, nothing to use right now.

On auto-workspace, yeah, there is no auto-workspace yet, which makes using workspace with dynamically provisionned PVC close to impossible with triggers indeed 😓