gpt4 book ai didi

kubernetes - k8s volume.attachments中的节点字段意味着什么?

转载 作者:行者123 更新时间:2023-12-02 12:00:13 25 4
gpt4 key购买 nike

我有以下Volume:

Name:         pvc-c8a0c1ee-b9e6-11e9-9ffa-0cc47ab04738
Namespace: rook-ceph-system
Labels: <none>
Annotations: <none>
API Version: rook.io/v1alpha2
Attachments:
Cluster Name: rook-ceph
Mount Dir: /var/lib/kubelet/pods/72fd4f89-5110-49b7-8d88-87488b58695c/volumes/ceph.rook.io~rook-ceph-system/pvc-c8a0c1ee-b9e6-11e9-9ffa-0cc47ab04738
Node: node-6.xyz.com
Pod Name: dev-cockroachdb-0
Pod Namespace: x-namespace
Read Only: false
Kind: Volume
Metadata:
Creation Timestamp: 2020-08-12T17:13:51Z
Generation: 6
Resource Version: 638003207
Self Link: /apis/rook.io/v1alpha2/namespaces/rook-ceph-system/volumes/pvc-c8a0c1ee-b9e6-11e9-9ffa-0cc47ab04738
UID: db0a9491-95fe-49cd-8160-89031847d636
Events: <none>
对于pod dev-cockroachdb-0,我收到以下错误:
MountVolume.SetUp failed for volume "pvc-c8a0c1ee-b9e6-11e9-9ffa-0cc47ab04738" : mount command failed, status: Failure, reason: Rook: Mount volume failed: failed to attach volume pvc-c8a0c1ee-b9e6-11e9-9ffa-0cc47ab04738 for pod x-namespace/dev-cockroachdb-0. Volume is already attached by pod x-namespace/dev-cockroachdb-0. Status Pending
并且pod x-namespace/dev-cockroachdb-0当前计划为 node-5.xyz.com
因此,您可以看到Pod本身与 VolumeAttachment位于不同的节点中。 node-6.xyz.comnode-5.xyz.com
问题:
  • Node中的Volume.Attachments是否指向 pods (连接了卷)所在的节点吗? (因此,如果将卷附加到节点NodeA上的Pod上,则该卷附件的节点字段的值为NodeA)
  • 可能由于无法正确分离某个节点上的卷而发生此错误吗?
  • 最佳答案

    您没有提及它,但看起来您有一个Rook量。也许是pvc克隆,像这样:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: rbd-pvc-clone
    spec:
    storageClassName: rook-ceph-block
    dataSource:
    name: rbd-pvc
    kind: PersistentVolumeClaim
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 1Gi

    Does Node in Volume.Attachments point to the node on which the pod (to which the volume is attached) is located? (So if the volume is attached to a pod on node NodeA, then the value of node field for the volume attachment will be NodeA)


    并非如此,您的Pod可能正在尝试从 node-5.xyz.com开始,但是在您的情况下,该卷可能会附加到另一个节点 node-6.xyz.com

    May this error happen because of the failure to correctly detach the volume on some node?


    是的,如果您有另一个在 node-6.xyz.com中运行且已终止且无法分离的pod运行,则可能会发生此错误。
    请记住,以上所有内容都在考虑您的卷具有 accessModes: ReadWriteOnce。看起来您正在将Ceph与Rook一起使用,在这种情况下,您还可以使用 accessModes: ReadWriteMany ,这实际上将允许您将卷附加到Kubernetes节点。
    ✌️

    关于kubernetes - k8s volume.attachments中的节点字段意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63385648/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com