1

我正在使用Microk8s(1.19,在 Ubuntu 20.04.1 LTS 上)并尝试使用OpenOBS(cStor 引擎)进行存储。

由于我在推送到 prod 之前在本地运行它,因此我创建了虚拟块设备:

blockdevicedisk='/k8storage/diskimage'
blockdevicesize=10000
sudo dd if=/dev/zero of=$blockdevicedisk bs=1M count=$blockdevicesize
sudo mkfs.ext4 $blockdevicedisk
sudo losetup /dev/loop0 /k8storage/diskimage
$lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0   7:0    0  9.8G  0 loop
loop1   7:1    0  7.8G  0 loop
sda     8:0    0  256G  0 disk
sdb     8:16   0  256G  0 disk /

我用 helm 安装了 OpenEBS,然后从 openebs-ndm-config -> filterconfigs -> path-filter -> exclude 中删除了“循环”。这样 ndm 会将这些显示为块设备。

$kubectl get blockdevices -n openebs
NAME                                           NODENAME   SIZE           CLAIMSTATE   STATUS   AGE
blockdevice-87ca7d6819eab3ea3af2884f2f6e9f8e   v          274877906944   Unclaimed    Active   19h
blockdevice-0a6c8d26081660a37f0a87dbb316c7ae   v          10485760000    Unclaimed    Active   19h
blockdevice-cd43d37664edd1c880e11f5b8e9cbe60   v          8388608000     Unclaimed    Active   19h

^ 最后两个是我做的。然后我编写了配置来创建一个 cStor StoragePoolClaim

apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
  name: cstor-pool-claim
spec:
  name: cstor-pool-claim
  type: disk
  poolSpec:
    poolType: striped
  blockDevices:
    blockDeviceList:
    - blockdevice-0a6c8d26081660a37f0a87dbb316c7ae
    - blockdevice-cd43d37664edd1c880e11f5b8e9cbe60

当我应用它时,两个块设备都被声明

$kubectl get blockdevices -n openebs
NAME                                           NODENAME   SIZE           CLAIMSTATE   STATUS   AGE
blockdevice-87ca7d6819eab3ea3af2884f2f6e9f8e   v          274877906944   Unclaimed    Active   19h
blockdevice-0a6c8d26081660a37f0a87dbb316c7ae   v          10485760000    Claimed      Active   19h
blockdevice-cd43d37664edd1c880e11f5b8e9cbe60   v          8388608000     Claimed      Active   19h

这是预期的。

$kubectl get spc
NAME               AGE
cstor-pool-claim   18h

但是,有一个问题!

$kubectl get csp
NAME                    ALLOCATED   FREE   CAPACITY   STATUS   READONLY   TYPE      AGE
cstor-pool-claim-nf0g                                 Init     false      striped   19h

它永远不会从初始化状态改变。创建了一个 pod,显示错误为

$kubectl describe pod cstor-pool-claim-nf0g-6cb75f8f49-sw6q2 -n openebs

如果有帮助,我可以显示很多文字。关键部分是错误消息,即:

错误:未能创建容器任务:OCI 运行时创建失败:container_linux.go:370:启动容器进程导致:process_linux.go:459:容器初始化导致:rootfs_linux.go:59:mounting "/var/snap/microk8s/common /run/containerd/io.containerd.grpc.v1.cri/sandboxes/a9b84df9076c91b83982f157e9bacdc5a10f80846d32034dd15cdae1c1d4c4c1/shm”到 rootfs 在“/dev/shm”导致:安全连接:太多级别的符号链接:未知

我已经尝试重置我的设置并一一重新输入命令以确保我正确地遵循了文档和其他示例,但是,我一直遇到这个错误。

这是microk8s的限制吗?OpenEBS 的故障?我的设置有什么奇怪的吗?还是我做错了什么?

更重要的是:有没有办法让它正常工作?

4

0 回答 0