Skip to content

tkn pipeline start --workspace support for volumeClaimTemplates #1006

@mnuttall

Description

@mnuttall

Version and Operating System

tkn Version: 0.9.0

Operating System: Tekton Pipeline v0.12.1

Expected Behavior

volumeClaimTemplates in Pipelines v0.12.1 are a nice way to start PipelineRuns with a dynamically generated PersistentVolumeClaim (PVC). See here for a sample in the main code base. The tkn docs list several options when using tkn pipeline start to specify workspace settings, but they do not include support for volumeClaimTemplates.

Without this support, Tekton v1beta1 pipelines using workspaces and no PipelineResources are easier to start using kubectl create [PipelineResource] than tkn pipeline start, because volumeClaimTemplates are so extremely useful. They are however rather verbose:

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: run-with-template-
spec:
  pipelineRef:
    name: cat-pipeline-readme
  workspaces:
    - name: shared-workspace
      volumeClaimTemplate:
        metadata:
          name: mypvc
        spec:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 50Mi

Almost all of this is boilerplate that could be auto-generated. If tkn wanted to pick a default storage size then we could

tkn pipeline start [name] --workspace name=[name],volumeClaimTemplate=true

If we did not want to go that far, maybe

tkn pipeline start [name] --workspace name=[ws],volumeClaimTemplate=name=myPrefix,size=50Mi

Flattening the volumeClaimTemplate into comma separated values in a usable way seems like the hardest part of the problem.

Actual Behavior

--workspace does not support volumeClaimTemplates as of tkn v0.9.

Steps to Reproduce the Problem

  1. Attempt to turn this into tkn syntax
  2. Notice it's not possible

Additional Info

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions