> <
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md> and
> I have the following questions:
>
> 1. Does CSI support static provisioning(volume already provisioned out
> of band)?
Yes, there is nothing special in CSI. Just create PV with
CSIPersistentVolumeSource with the fields that your CSI driver understands.
> 2. What are the use cases for CSI to support secrets in various APIs?
> Assuming that the creds to provision the volume is same, how is
> using secrets for every CSI API better than a solution where volume
> driver is configured with specific a secret having necessary creds?
If you create your PVs manually, they can refer to
ControllerPublishSecretRef, NodeStageSecretRef and NodePublishSecretRef
that are given to CSI driver in those particular calls. I don't think
that Kubernetes can do the same with dynamically provisioned volumes. It
is expected there that the driver itself has necessary secrets to attach
/ mount volumes it provisioned.
> 3. How is NodeStageVolume/NodeUnstageVolume different to
> NodePublishVolume/NodeUnpublishVolume in terms of functionality?
They behave differently when multiple pods on the same node use the same
volume. NodeStage is called once and it should mount the volume to
given "global" directory. NodePublish is then called separately for each
pod, possibly with different options (e.g. some pods have the volume
read-only). Typically, NodePublish should bind-mount the volume from the
"global" directory to given "pod" directory.
NodeStage typically applies to volumes backed by a block device - you
can mount it just once (NodeStage) and then you just bind-mount it to
individual pods (NodePublish). NodeUnstage will be called only when all
pods are gone, so you don't need to track the mounts in the driver. For
NFS, you're fine with just NodePublish.
> 4. In-tree volume provisioners can implement
> Attacher.VolumesAreAttached and BulkVolumeVerifier to make sure that
> the volumes are periodically monitored and reconciled. I don't see
> such a support in CSI. Does CSI support monitoring/reconciling volumes?
Not yet. We assume that the driver itself keeps the volumes attached.
There is no way how a driver would tell Kubernetes that something is not
attached (mounted, ...) any longer.