As far as i understood, the kubernetes api allows one to mount a subpath of a pvc into the container in the volumeMounts
spec.
In my example i want to mount the pvc my-pvc
, but in the subdirectory /my-subpath
to /my-mount
.
So the directory /my-subpath
on my-pvc
would be mounted in the container under /my-mount
.
When using Kubernetes normally, this would look like follows if i understood the docs:
volumeMounts:
- mountPath: /my-mount
name: my-pvc
subPath: "my-subpath"
My problem now is, that in the jenkins kubernetes plugin this doesn't seem to be possible.
If i understood the docs correctly, it seems that it is only possible to mount the root directory, i.e. /
, of the pvc my-pvc
to /my-mount
in the container, since there is no subPath
option:
Is there something i am missing, or is it just not possible to do this?