无法在 Kubernetes 裸机部署的 pods 上安装由 OpenEBS 创建的 PVC

Unable to mount PVC created by OpenEBS on pods on Kubernetes bare-metal deployment

我在 pods 上安装 pvc 时遇到问题,openebs 安装在使用 RKE 创建的裸机 kubernetes 集群上。

预期行为

PVC 应该可以毫无问题地安装在 pods 上。

当前行为

Pods 无法装载 PVC:

  Events:
  Type     Reason                  Age                    From                     Message
  ----     ------                  ----                   ----                     -------
  Warning  FailedScheduling        2m9s (x23 over 2m45s)  default-scheduler        pod has unbound PersistentVolumeClaims (repeated 4 times)
  Normal   Scheduled               2m8s                   default-scheduler        Successfully assigned default/minio-deployment-64d7c79464-966jr to 192.168.1.21
  Normal   SuccessfulAttachVolume  2m8s                   attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-63cf6c92-ec99-11e8-85c9-b06ebfd124ff"
  Warning  FailedMount             84s (x4 over 102s)     kubelet, 192.168.1.21    MountVolume.WaitForAttach failed for volume "pvc-63cf6c92-ec99-11e8-85c9-b06ebfd124ff" : failed to get any path for iscsi disk, last err seen:
iscsi: failed to sendtargets to portal 10.43.227.122:3260 output: iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: cannot make connection to 10.43.227.122: Connection refused
iscsiadm: connection login retries (reopen_max) 5 exceeded
iscsiadm: No portals found
, err exit status 21
  Warning  FailedMount  24s (x4 over 80s)  kubelet, 192.168.1.21  MountVolume.WaitForAttach failed for volume "pvc-63cf6c92-ec99-11e8-85c9-b06ebfd124ff" : failed to get any path for iscsi disk, last err seen:
iscsi: failed to attach disk: Error: iscsiadm: Could not login to [iface: default, target: iqn.2016-09.com.openebs.jiva:pvc-63cf6c92-ec99-11e8-85c9-b06ebfd124ff, portal: 10.43.227.122,3260].
iscsiadm: initiator reported error (12 - iSCSI driver not found. Please make sure it is loaded, and retry the operation)
iscsiadm: Could not log into all portals
Logging in to [iface: default, target: iqn.2016-09.com.openebs.jiva:pvc-63cf6c92-ec99-11e8-85c9-b06ebfd124ff, portal: 10.43.227.122,3260] (multiple)
 (exit status 12)
  Warning  FailedMount  2s  kubelet, 192.168.1.21  Unable to mount volumes for pod "minio-deployment-64d7c79464-966jr_default(640263d0-ec99-11e8-85c9-b06ebfd124ff)": timeout expired waiting for volumes to attach or mount for pod "default"/"minio-deployment-64d7c79464-966jr". list of unmounted volumes=[storage]. list of unattached volumes=[storage default-token-9n8pn]

重现步骤

  1. 用helm安装openebs
  2. 创建一个存储 class 为 openebs-standalone
  3. 的 pvc
  4. 创建 pod 并尝试挂载 PVC。

kubectl get pvc:

root@an4:/home/rke-k8s# kubectl get pvc
NAME                                      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS         AGE
docker-private-registry-docker-registry   Bound    pvc-58cf63c1-ec95-11e8-9b5d-2cfda16d3cfd   10Gi       RWO            openebs-standalone   22m

更新

当我尝试示例 minio 部署时,这是我观察到的:

  1. 创建 PVC 大约需要 1-2 分钟。
  2. 将 PVC 安装到 pod 花费了大约 1 小时。
  3. 用于此的存储 class 是 openebs-standard

有什么原因吗?它是本地集群部署。

这是 openebs 的问题,已经与团队一起解决了。修复仍在进行中,您可以在此处跟踪问题:

https://github.com/openebs/openebs/issues/1688

这里有如何调试问题的分步说明。希望这有帮助。

嗯,故障排除指南中记录了这个问题 - https://docs.openebs.io/docs/next/tsgiscsi.html