Share a DynamicPVC between jenkins-pod-agents

Context: Using jenkins in Kubernetes, and kubenetes pods as jenkins agents ( with the jenkins-kubernetes plugin )

The use-case I need:

  • mount a cache volume to multiple pods
  • that cache volume needs to be dynamically provisioned, and only live for the duration of a jenkins-build

is it possible to have a setup like:

podTemplate(){
// this first pod provisions a Dynamic PVC 

   podTemplate(){
      // this pod references and mounts the PVC created by the outer-pod
   }

   podTemplate(){
      // another pod references and mounts the PVC created by the outer-pod
   }
}
// the volume is deleted here as it is not used by any pod anymore. 

maybe this is not implemented in the current version of the jenkins-kubernetes plug-in. but would this be a use-case that can be implemented ( without breaking anything else in that plugin) ?

1 Like