So let's take each part of the CSIVolumeSource:
- for the
Driver
string field, it needs to be "csi.sharedresource.openshift.io". - for the
VolumeAttributes
map, this driver currently inspects the "sharedConfigMap" key or "sharedSecret" key (which map theSharedConfigMap
ORSharedSecret
instance yourPod
wants to use) in addition to the elements of thePod
the kubelet stores when contacting the driver to provision theVolume
. See this list. - NOTE: you cannot specify both a "sharedConfigMap" and "sharedSecret" key. An error will be flagged. An error will also be flagged if neither is present, or if the value for one or the other does not equal the name of a
SharedConfigMap
orSharedSecret
- the
ReadOnly
field is required to be set to 'true'. This follows conventions introduced in upstream Kubernetes CSI Drivers to facilitate proper SELinux labelling. What occurs is that this driver will return a read-write linux file system to the kubelet, so that CRI-O can apply the correct SELinux labels on the file system (CRI-O would not be able to update the SELinux labels on a read only file system after it is created), but the kubelet still makes sure that the file system later exposed to the consuming pod (which sits on top of the file system returned by this repository's driver) is read only. If this driver allowed both read-only and read-write, there is in fact no way to provide differing support that still allows for correct SELinux labelling for each). - Also, mounting of one
SharedConfigMap
ORSharedSecret
off of a subdirectory of anotherSharedConfigMap
ORSharedSecret
is NOT supported. The driver only supports read-onlyVolumes
. - the
FSType
field is ignored. This driver by design only supportstmpfs
, with a different mount performed for eachVolume
, in order to defer all SELinux concerns to the kubelet. - the
NodePublishSecretRef
field is ignored. The CSINodePublishVolume
andNodeUnpublishVolume
flows gate the permission evaluation required for theVolume
by performingSubjectAccessReviews
against the referenceSharedConfigMap
ORSharedSecret
instance, using theserviceAccount
of thePod
as the subject. - Similar to what is noted for the upstream "Secrets Store CSI Driver", because of the use of atomic writer, neither
Secret
orConfigMap
content is rotated when using 'subPath' volume mounts. The upstream driver documentation has a good explanation as to the details here