add support for persistence.subPath option #263
Reference in New Issue
Block a user
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.subPathoption to provide user more flexibility on mounting thedataPV.https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath
The setting is similar to e.g.
primary.persistence.subPathin 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
subPathoption.And you are right: if
subPathdoes not exist, k8s will create it asrootand 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
subPathin e.g.postgresqlormariadbhelm charts.subPathappears in README and under the relatedvolumeMounts. Just as in this PRWould also like to mention this one:
What will happen is that
PV:/git/.sshwill becomePOD:/data. We do not alter the mount points inside pod. We only choose a subdirectory in PV to be mounted as/dataTIL. 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