Ceci est une ancienne révision du document !
Création d'un fournisseur de LUN iSCSI dans kubernetes
Il existe un contrôleur capable de piloter à distance un serveur iSCSI targetd. Cela permet de créer une classe de stockage de type iSCSI targetd, afin d'avoir des volumes utilisant des LUNs iSCSI créés à la volée par ce contrôleur.
Classe de stockage
Création d'une storage class avec les info de notre serveur targetd :
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: iscsi-targetd-vg-targetd provisioner: iscsi-targetd parameters: # this id where the iscsi server is running targetPortal: 192.168.2.107:3260 # if you are using multipath, you can specify additional IPs here, default empty # portals: 192.168.99.101:3260,192.168.99.102:3260 # this is the iscsi server iqn iqn: iqn.2019-02.org.linux-iscsi.k8s:targetd # this is the iscsi interface to be used, the default is default # iscsiInterface: default # this must be on eof the volume groups condifgured in targed.yaml, the default is vg-targetd volumeGroup: iscsi # this is a comma separated list of initiators that will be give access to the created volumes, they must correspond to what you have configured in your nodes. initiators: iqn.2019-02.org.linux-iscsi.k8s:dockernode0,iqn.2019-02.org.linux-iscsi.k8s:dockernode1,iqn.2019-02.org.linux-iscsi.k8s:dockernode2 # whether or not to use chap authentication for discovery operations chapAuthDiscovery: "false" # whether or not to use chap authentication for session operations chapAuthSession: "false" # This is the filesystem you want your volume to be formatted with, default xfs # fsType: xfs # Whether the volume should be mounted in readonly mode, default false # readonly: false
Puis pour l'appliquer :
kubectl apply -f iscsi-provisioner-class.yaml