<p>I have problems with connecting volume per iSCSI from Kubernetes. When I try with iscisiadm from worker node, it works. This is what I get from kubectl description pod.</p>
<pre><code>Normal   Scheduled               &lt;unknown&gt;             default-scheduler        Successfully assigned default/iscsipd to k8s-worker-2
Normal   SuccessfulAttachVolume  4m2s                  attachdetach-controller  AttachVolume.Attach succeeded for volume &quot;iscsipd-rw&quot;
Warning  FailedMount             119s                  kubelet, k8s-worker-2    Unable to attach or mount volumes: unmounted volumes=[iscsipd-rw], unattached volumes=[iscsipd-rw default-token-d5glz]: timed out waiting for the condition
Warning  FailedMount             105s (x9 over 3m54s)  kubelet, k8s-worker-2    MountVolume.WaitForAttach failed for volume &quot;iscsipd-rw&quot; : failed to get any path for iscsi disk, last err seen:iscsi: failed to attach disk: Error: iscsiadm: No records found(exit status 21)
</code></pre>
<p>I'm just using <code>iscsi.yaml</code> file from kubernetes.io!</p>
<pre><code>---
apiVersion: v1
kind: Pod
metadata:
  name: iscsipd
spec:
  containers:
  - name: iscsipd-rw
    image: kubernetes/pause
    volumeMounts:
    - mountPath: &quot;/mnt/iscsipd&quot;
      name: iscsipd-rw
  volumes:
  - name: iscsipd-rw
    iscsi:
      targetPortal: 192.168.34.32:3260
      iqn: iqn.2020-07.int.example:sql
      lun: 0
      fsType: ext4
      readOnly: true
</code></pre>
<p>Open-iscsi is installed on all worker nodes(just two of them).</p>
<pre><code>● iscsid.service - iSCSI initiator daemon (iscsid)
   Loaded: loaded (/lib/systemd/system/iscsid.service; enabled; vendor preset: e
   Active: active (running) since Fri 2020-07-03 10:24:26 UTC; 4 days ago
     Docs: man:iscsid(8)
  Process: 20507 ExecStart=/sbin/iscsid (code=exited, status=0/SUCCESS)
  Process: 20497 ExecStartPre=/lib/open-iscsi/startup-checks.sh (code=exited, st
 Main PID: 20514 (iscsid)
    Tasks: 2 (limit: 4660)
   CGroup: /system.slice/iscsid.service
           ├─20509 /sbin/iscsid
           └─20514 /sbin/iscsid
</code></pre>
<p>ISCSI Target is created on the IBM Storwize V7000. Without CHAP.</p>
<p>I tried to connect with iscsiadm from worker node and it works.</p>
<pre><code>sudo iscsiadm -m discovery -t sendtargets -p 192.168.34.32
192.168.34.32:3260,1 iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1
192.168.34.34:3260,1 iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1

sudo iscsiadm -m node --login
Logging in to [iface: default, target: iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1, portal: 192.168.34.32,3260] (multiple)
Logging in to [iface: default, target: iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1, portal: 192.168.34.34,3260] (multiple)
Login to [iface: default, target: iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1, portal: 192.168.34.32,3260] successful.
Login to [iface: default, target: iqn.1986-03.com.ibm:2145.hq-v7000.hq-v7000-rz1-c1, portal: 192.168.34.34,3260] successful.

Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
Disklabel type: dos
Disk identifier: 0x5b3d0a3a

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1        2048 209715199 209713152  100G 83 Linux
</code></pre>
<p>Is anyone facing the same problem?</p>

markoc
<p><strong>Remember to not use a hostname for the target.</strong> Use the IP. For some reason, if the target is a hostname, it barfs with the error about requesting a duplicate session. If the target is an IP, it works fine. I now have multiple iSCSI targets mounted in various pods, and I am absolutely ecstatic.</p>
<p>You may also have authentication issue to your iscsi target.</p>
<p>If you don't use CHAP authentication yet, you still have to disable authentication. For example, if you use  <code>targetcli</code>, you can run below commands to disable it.</p>
<pre><code>$ sudo targetcli
/&gt; /iscsi/iqn.2003-01.org.xxxx/tpg1 set attribute authentication=0 # will disable auth
/&gt; /iscsi/iqn.2003-01.org.xxxx/tpg1 set attribute generate_node_acls=1 # will force to use tpg1 auth mode by default

</code></pre>
<p>If this doesn't help you, please share your iscsi target configuration, or guide that you followed.</p>
<p><strong>What is important check if all of your nodes have the open-iscsi-package installed.</strong></p>
<p>Take a look: <a href="https://github.com/rancher/rancher/issues/12433" rel="nofollow noreferrer">kubernetes-iSCSI</a>, <a href="https://stackoverflow.com/questions/55920173/kubernetes-pod-cannot-mount-iscsi-volume-failed-to-get-any-path-for-iscsi-disk">volume-failed-iscsi-disk</a>, <a href="https://discuss.kubernetes.io/t/solved-iscsi-into-container-fails/1034" rel="nofollow noreferrer">iscsi-into-container-fails</a>.</p>
