ZBLOG

kubernetes 通过 volume 挂在 cephfs 是,当 cephfs 存在多个 fs 如何指定某一个fs

在 Kubernetes 中使用 CephFS Volume 时,可以通过在 volume 的配置中指定 monitors 参数来指定连接到哪个 Ceph 集群的 Monitor。例如:

apiVersion: v1
kind: Pod
metadata:
  name: cephfs-pod
spec:
  containers:
    - name: cephfs-container
      image: busybox
      command: ["/bin/sh", "-c", "sleep 3600"]
      volumeMounts:
        - name: cephfs-vol
          mountPath: /mnt/cephfs
  volumes:
    - name: cephfs-vol
      cephfs:
        monitors:
          - "192.168.1.101"
          - "192.168.1.102"
        user: admin
        secretRef:
          name: ceph-secret
        readOnly: false
        path: "/my-fs"

在上述配置中,我们通过 monitors 参数指定了连接到 IP 地址为 192.168.1.101192.168.1.102 的 Monitors,同时通过 path 参数指定了要挂载的 CephFS 文件系统路径为 /my-fs。这样就可以指定挂载某一个具体的文件系统了。

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=3905

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?