add support for persistence.subPath option #263
Reference in New Issue
Block a user
No description provided.
Delete Branch "add-persistence-subPath"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
PR adds a
persistence.subPath
option to provide user more flexibility on mounting thedata
PV.https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath
The setting is similar to e.g.
primary.persistence.subPath
in MariaDB helm chart:https://github.com/bitnami/charts/tree/master/bitnami/mariadb
Hi. Depending on the subpath, it won't work as expected. For some paths, permissions will be changed or it even gets created. For a mount point such things are not allowed. Imaging setting the subpath to git/.ssh, would currently break the init container. I think there is more work to do here.
What was the intention to add the subpath?
Hi!
In my situation there are multiple PVs pointing into the same NFS share. Different deployments can store their files in different directories by using the
subPath
option.And you are right: if
subPath
does not exist, k8s will create it asroot
and it will likely cause some troubles for the app.However, PV allocation is a task for k8s cluster admins and if they tell you to use a specific directory then it should be ok to assume that directory is already there and has correct owner/permissions on it.
Also I didn't notice any special handling for
subPath
in e.g.postgresql
ormariadb
helm charts.subPath
appears in README and under the relatedvolumeMounts
. Just as in this PRWould also like to mention this one:
What will happen is that
PV:/git/.ssh
will becomePOD:/data
. We do not alter the mount points inside pod. We only choose a subdirectory in PV to be mounted as/data
TIL. I read the k8s docs incorrectly or they weren't that detailed when last reading them. You are absolutely right. subpath is for the PV not the Pod mount path.
LGTM
LGTM