Can I mount a Persistent Volume in my pipeline?

Tekton already mounts a separate Persistent Volume for each build pod at /workspace so the build results are kept around for a while until they are garbage collected.

On most kubernetes clusters you cannot easily share a single Persistent Volume across multiple pods; so having a shared PV across builds isn’t generally easy or compatible. You can however add a step to populate your PV on startup from a cloud bucket and at the end of a pipeline copy data into a bucket to speed up caching.

You can also do things like use Nexus as a network cache for fetching maven dependencies (which happens OOTB with Maven builds in Jenkins X) or add the Athens proxy for Go.

Hopefully the Tekton community will figure out some even better caching solutions to speed up builds.