我想在一个豆荚中添加一个iSCSI卷,就像在这个这个例子中一样。我已经在Debian服务器上准备了一个iSCSI目标,并在我的所有工作节点上安装了open-iscsi。我还确认可以使用命令行工具(即仍在Kubernetes之外)将iSCSI目标挂载到工作节点上。这个很好用。为了简单起见,还没有进行身份验证(CHAP),而且目标上已经存在一个ext4文件系统。
现在,我希望Kubernetes 1.14将相同的iSCSI目标挂载到一个具有以下清单的荚中:
---
apiVersion: v1
kind: Pod
metadata:
name: iscsipd
spec:
containers:
- name: iscsipd-ro
image: kubernetes/pause
volumeMounts:
- mountPath: "/mnt/iscsipd"
name: iscsivol
volumes:
- name: iscsivol
iscsi:
targetPortal: 1.2.3.4 # my target
iqn: iqn.2019-04.my-domain.com:lun1
lun: 0
fsType: ext4
readOnly: true根据kubectl describe pod,这在初始阶段(SuccessfulAttachVolume)工作,但随后失败(FailedMount)。确切的错误消息如下:
Warning FailedMount ... Unable to mount volumes for pod "iscsipd_default(...)": timeout expired waiting for volumes to attach or mount for pod "default"/"iscsipd". list of unmounted volumes=[iscsivol]. list of unattached volumes=[iscsivol default-token-7bxnn]
Warning FailedMount ... MountVolume.WaitForAttach failed for volume "iscsivol" : failed to get any path for iscsi disk, last err seen:
Could not attach disk: Timeout after 10s我如何进一步诊断和克服这个问题?
更新中与这相关的问题解决方案包括为目标使用一个数字IP地址。但是,这对我的情况没有帮助,因为我已经在使用表单targetPortal的1.2.3.4 (同时尝试了端口号3260和没有端口的情况)。
UPDATE停止scsid.service和/或open-iscsi.service (如建议的这里)也没有什么区别。
UPDATE如果waitForPathToExist(&devicePath, multipathDeviceTimeout, iscsiTransport)失败,显然会在pkg/volume/iscsi/iscsi_util.go中触发错误。然而,奇怪的是,当它被触发时,devicePath (/dev/disk/by-path/ip-...-iscsi-...-lun-...)上的文件实际上存在于节点上。
UPDATE我使用这个过程为这些测试目的定义了一个简单的iSCSI目标:
pvcreate /dev/sdb
vgcreate iscsi /dev/sdb
lvcreate -L 10G -n iscsi_1 iscsi
apt-get install tgt
cat >/etc/tgt/conf.d/iscsi_1.conf <<EOL
<target iqn.2019-04.my-domain.com:lun1>
backing-store /dev/mapper/iscsi-iscsi_1
initiator-address 5.6.7.8 # my cluster node #1
... # my cluster node #2, etc.
</target>
EOL
systemctl restart tgt
tgtadm --mode target --op show发布于 2019-05-06 13:51:22
这可能是因为您的iscsi目标存在身份验证问题。
如果您尚未使用CHAP身份验证,则仍然必须禁用身份验证。例如,如果使用targetcli,可以运行以下命令来禁用它。
$ sudo targetcli
/> /iscsi/iqn.2003-01.org.xxxx/tpg1 set attribute authentication=0 # will disable auth
/> /iscsi/iqn.2003-01.org.xxxx/tpg1 set attribute generate_node_acls=1 # will force to use tpg1 auth mode by default如果这对您没有帮助,请分享您的iscsi目标配置,或您所遵循的指南。
发布于 2021-01-05 20:05:29
https://stackoverflow.com/questions/55920173
复制相似问题