我使用 Rancher v2 作为 k8s 管理平台并在 VMware vSphere 上运行 RancherOS 节点。我手动安装了 open-iSCSI 并在工作节点上安装了一个 50GB 的卷以供 OpenEBS 使用(必须弄清楚如何在节点创建时自动执行该操作)。我还创建了一个 cStor 存储类,一切看起来都不错。但是,我无法获得一个容器来使用 pvc 配置 pv。
Warning FailedMount Unable to mount volumes for pod "web-test-54d9845456-bc8fc_infra-test(10f856c1-6882-11e9-87a2-0050568eb63d)": timeout expired waiting for volumes to attach or mount for pod "infra-test"/"web-test-54d9845456-bc8fc". list of unmounted volumes=[cstor-vol-01]. list of unattached volumes=[web-test-kube-pvc vol1 man-volmnt-01 cstor-vol-01 default-token-lxffz]
Warning FailedMount MountVolume.WaitForAttach failed for volume "pvc-b59c9b5d-6857-11e9-87a2-0050568eb63d" : failed to get any path for iscsi disk, last err seen: iscsi: failed to sendtargets to portal 10.43.48.95:3260 output: iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not add new discovery record. , err exit status
我已按照以下步骤从 OpenEBS 文档中的 RancherOS Prerquisitee 部分启用 RancherOS 上的 iSCSI。
sudo ros s up open-iscsi
sudo ros config set rancher.services.user-volumes.volumes [/home:/home,/opt:/opt,/var/lib/kubelet:/var/lib/kubelet,/etc/kubernetes:/etc/kubernetes,/var/openebs]
sudo system-docker rm all-volumes
sudo reboot