I am just wondering when k8s mounts a volume to pod, does the size of the directory to mount matters or not, when I say 'matter', I mean if it will take more time with large directory.
For example, if below file1 and dir1 is very large, will it take more time?
volumeMounts:
- name: "config"
mountPath: "/<existing folder>/<file1>"
subPath: "<file1>"
- name: "config"
mountPath: "/<existing folder>/<dir1>"
subPath: "<dir1>"
restartPolicy: Always
volumes:
- name: "config"
configMap:
name: "config"
The size does not matter, the 'mount' is a bind-mount which overlays and unifies multiple filesystems to a virtual view. There is no real mount happening like with external filesystems where a metadata check or even filesystem check might be performed.
You can imagine the bind mount a little bit like a symlink, so it is cheap and independent of the size.