Hy Drum Big,
we have exactky the same challenge.
We're using the Jekins k8s Plugin, and have some big git repos. Therefore we cannot clone the repos in case of perfomance (it takes 4min).
So with a traditional Jenkins Infrastructure, there's a node, Jenkins sets up a unique directory for each EXECUTOR. As with kubernetes there's nothing like an executor for a node, while the so known nodes in kubernetes are only temporay spawned for one build.
As a result, there's no unique directory created by jenkins in the kubernetes world, therefore we need a possibility to map a persistent volume like the unique directory setup by jenkins. Otherwise we always have to clone the git repo (okay there's some performace boosts possible: e.g: git clone -b <branch> <url> --depth=1, but that's not a great solution comparing to an update on a given repo).
Maybe there a possiblity to get the information of the unique jenkins path in order to use it as an ID for a unique persistence volume.
what are you calling EXECUTOR_NUMBER ? have you seen this somewhere?
why do you say "available for yaml definition" when the yaml already supports everything kubernetes does?