Support custom build dir volume in Kubernetes Executor
What does this MR do?
Adds support for a non-default custom builds directory volume and volumeMount in the kubernetes executor.
Why was this MR needed?
In some situations, it is not sufficient to use a standard empty_dir volume for storing the repo (as well as all the contents of $CI_PROJECT_DIR
by the end of a CI job.) Large repositories come to mind where some power users that understand what they're doing might specify to use a PVC as the builds directory volume/mount.
In some other cases, using a CSI volume might be more appropriate than an empty_dir. For example, an ephemeral inline volume provides more flexibility on the storage medium than a typical empty_dir. One example of a CSI driver provider that could be used for this is Portworx.
Another example where this is useful is with empty_dir volumes using an in-memory storage medium.
What's the best way to test this MR?
Spin up a runner with a config.toml containing something like the following:
[runners.kubernetes.builds_dir.empty_dir]
name = "repo"
mount_path = "/builds"
medium = "Memory"