我使用Rancher v2作为k8s管理平台,并在VMware vSphere上运行RancherOS节点。我手动安装了open-iSCSI,并在工作节点上挂载了一个50 on的卷,以供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我按照以下步骤在RancherOS文档的RancherOS前提条件部分启用OpenEBS。
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发布于 2019-04-29 18:09:11
从Rancher OS的github存储库中,发现我们需要创建一个锁定目录,并确保使用以下方式在每次引导时创建此目录
$ mkdir /run/lock
# update cloud-config
#cloud-config
runcmd:
- [mkdir, /run/lock]引用路径: rancher的github repo。然后在rancher/OS下找到问题号2435
https://stackoverflow.com/questions/55898164
复制相似问题