CSIDriver Object
A Pod mounts a disk and an NFS share through two CSI drivers. Only the disk is attached to the Node, and only the NFS driver is told which Pod the mount is for. Where does the cluster learn how to treat each driver?
Play the animation 3 steps, animated, plays on a computer or a tablet
CSIDriver Object, step by step
-
Each volume names its driver, and each driver here has a cluster scoped CSIDriver object of that exact name. From that object the attach and detach controller reads attachRequired. The disk driver says true, so the controller writes VolumeAttachment csi-5e8b. The NFS driver says false, so no attach is needed.
Play from step 1 -
With csi-5e8b attached, Kubelet reads both objects and calls NodePublishVolume on each plugin. Kubelet adds Pod info such as name, namespace and UID only to the NFS call, where podInfoOnMount is true. Neither driver applies fsGroup itself, so with File Kubelet sets data to group 2000, while with None shared stays as exported. The Pod runs.
Play from step 2 -
Suppose instead the NFS driver ships no CSIDriver object, and no field is set. Then the controller and Kubelet take attachRequired as true. The controller writes VolumeAttachment csi-c41d, but this driver runs no external-attacher, so nothing marks csi-c41d attached. Volume shared stays unmounted and the Pod waits in ContainerCreating.
Play from step 3