Is there a way to pass the claim as VolumeClaimTemplate and then provide its values to the pipeline so those are used when the PipelineRun is created at the execution of the pipeline instead of a PVC?
I have this VolumeClaimTemplate (see the image) and need to pass its details through the tkn start pipeline-name CLI command:
My entire CLI command is as next:
tkn pipeline start run-tests-portal-with-report --showlog \
-w name=shared-data,claimName=VolumeClaimTemplate,storageClassName=default-netapp-disk,accessModes=ReadWriteOnce,storage=1Gi,volumeMode=Filesystem \
-w name=git-credentials,secret=gh-token \
-p repo-url=https://github.com/my-project-url \
-p revision=PRJT-123
Now this is the error I am getting in openshift:
message: >- pod status "PodScheduled":"False"; message: "0/12 nodes are available: 12 persistentvolumeclaim "VolumeClaimTemplate" not found. preemption: 0/12 nodes are available: 12 Preemption is not helpful for scheduling."
I understand the issue, but how do I tell it through the CLI that 'use this VolumeClaimTemplate' where the 'StorageClass is default-netapp-disk' with the other details (though when I manually select the storage class in the UI it automatically sets the access mode, size and volume mode) and then it'll use it to create the PersistentVolume at runtime within the PipelineRun?
I hope this is explanatory enough, Is this even doable?
I've tried many things and could not find a solution, I am not even sure this is doable.
The command that you provided will create an incorrect workspace in the
PipelineRun
that looks like this:You need to use the
volumeClaimTemplateFile
option with the—workspace
parameter when you use thetkn
CLI like the following (https://github.com/tektoncd/cli/pull/1066):Where
pvc.yaml
is the file that will be like that for your case:By running the command the generated
PipelineRun
will be: