Connect k8s pod to iscsi

5/26/2019

I'm using a terastation's iscsi capabilities to create storage for my k8s 1.14 cluster (kubeadm, ubuntu 18.04). I check the iqn:

iscsiadm --mode node
192.168.2.113:3260,1 iqn.2004-08.jp.buffalo.7403bd2a30a0.drupal-mysql

There's no ":". when I try to use

volumes:
    - name: iscsi-data
      iscsi:
        targetPortal: 192.168.2.113:3260
        iqn: "iqn.2004-08.jp.buffalo.7403bd2a30a0.drupal-mysql"
        lun: 0
        fsType: xfs

i get the error:

spec.template.spec.volumes[0].iscsi.iqn: Invalid value: "iqn.2004-08.jp.buffalo.7403bd2a30a0.drupal-mysql": must be valid format

i know its looking for something that ends in a ":name" but I can't figure out what thats supposed to be for the life of me. I know the iscsi drive mounts because i can see it on my node and was able to format it using xfs. I think I'm missing something really simple.

Thanks

-- mlbiam
iscsi
kubernetes

1 Answer

5/28/2019

iSCSI network storage standard is fully documented in RFC 3720 and RFC 3721 with an appropriate IQN constructing format for iSCSI names.

iSCSI qualified name (IQN), coressponds to the following form:

iqn.yyyy-mm.naming-authority:unique-name, where:

iqn – the prefix iqn.

yyyy-mm – the year and month when the naming authority was established. For example: 1992-08.

naming-authority – the organizational naming authority string, usually reverse syntax of the Internet domain name of the naming authority. For example: com.vmware.

unique name – any name you want to use, such as the name of your host. For example: host-1

In the above k8s volume spec case you might try to specify IQN like:

iqn: "iqn.2004-08.jp.buffalo:7403bd2a30a0.drupal-mysql"

Find some relative example about iSCSI volume provisioning in k8s cluster here.

-- mk_sta
Source: StackOverflow