我已经使用 docker -multinode 配置以及 Ceph 集群成功部署了 Kubernetes 集群,并且能够使用以下命令手动挂载 CephFS 设备:
sudo mount -t ceph monitor1:6789:/ /ceph -o name=admin,secretfile=/etc/ceph/cephfs.secret
我现在正在尝试使用此处的 kubernetes 示例启动一个 pod :
apiVersion: v1
kind: Secret
metadata:
name: ceph-secret
data:
key: my-ceph-secret-key
---
apiVersion: v1
kind: Pod
metadata:
name: cephfs2
spec:
containers:
- name: cephfs-rw
image: kubernetes/pause
volumeMounts:
- mountPath: "/mnt/cephfs"
name: cephfs
volumes:
- name: cephfs
cephfs:
monitors:
- "monitor1:6789"
- "monitor2:6789"
- "monitor3:6789"
user: admin
secretRef:
name: ceph-secret
readOnly: false
当我运行时:
sudo kubectl create -f cephfs.yml
我收到以下错误:
警告 FailedMount MountVolume.SetUp failed for volume "kubernetes.io/cephfs/445ee063-d1f1-11e6-a3e3-1418776a29a6-cephfs" (spec.Name: "cephfs") pod "445ee063-d1f1-11e6-a3e3-1418776a29a6" (UID : "445ee063-d1f1-11e6-a3e3-1418776a29a6") with: CephFS: mount failed: mount failed: fork/exec /bin/mount: invalid argument 挂载参数:monitor1:6789,monitor2:6789,monitor3:6789:/data /var/lib/kubelet/pods/445ee063-d1f1-11e6-a3e3-1418776a29a6/volumes/kubernetes.io~cephfs/cephfs ceph [name=admin,secret=secret]
kubernetes manager 容器是否需要安装 ceph-fs-common 包才能成功挂载?我找不到任何进一步的调试信息来确定错误的原因。