<p>Say like I have a targetd-alike iSCSI server, which (just like targetd) can provision iSCSI LUNs via APIs. To make this iSCSI server work with K8s dynamic PV provisioning, I've found two possible solutions after some Googlings.</p>

<p>The first solution is <a href="https://github.com/container-storage-interface/spec" rel="nofollow noreferrer">CSI</a>. Basically, I need to implement a CSI plugin that translate volume creation requests to LUN creation API calls, and also translate stash/mount requests to iscsiadm commands.</p>

<p>However, as I already knew that K8s supports statically pre-provisioned iSCSI LUN out-of-box, I wondered if I could just do the dynamic provision part and leave all the heavy-liftings (mount and iscsiadm commands) to K8s built-in iSCSI functionality. So later, I've found <a href="https://github.com/kubernetes-incubator/external-storage/tree/master/iscsi/targetd" rel="nofollow noreferrer">iSCSI-targetd provisioner</a> for K8s. It seems much simpler than a CSI plugin, and it only took 150 LOC to implement my provisioner for my iSCSI server.</p>

<p>I have a vague impression that K8s community is now moving towards CSI for external storage integrations. Does this mean that my latter provisioner way could be deprecated and should move to a CSI plugin?</p>

fengye87
<p>In fact CSI is the standardized way to storage provisioning, you can get iSCSi (emulated) block storage with several options nowadays, based on my experience, I would recommend to use:</p>

<ul>
<li><a href="https://rook.io" rel="nofollow noreferrer">rook.io</a>: Really great, good docs and coverage different aspects of storage (block,file,object and for different backends ...) </li>
<li><a href="https://github.com/gluster/gluster-block" rel="nofollow noreferrer">gluster-block</a>: it is a plug-in for gluster storage, this is used combined with heketi. See docs <a href="https://github.com/gluster/gluster-kubernetes/blob/master/docs/design/gluster-block-provisioning.md" rel="nofollow noreferrer">k8s provisioning</a></li>
</ul>

<p>By the way, gluster is the solution for CSI adopted by RedHat on Openshift 3, and it is pretty decent, feels like for Openshift 4 will be something with Ceph (mostly likely rook)</p>
