针对卷的GKE / Multi-Attach错误的卷声明已被专门附加 [英] Volume claim on GKE / Multi-Attach error for volume Volume is already exclusively attached

查看:1916
本文介绍了针对卷的GKE / Multi-Attach错误的卷声明已被专门附加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题似乎是很久以前解决了,因为答案和评论没有提供真正的解决方案,我想从有经验的用户那里获得一些帮助。

b
$ b

错误如下(描述持续处于ContainerCreating状态的pod时):

 卷的多附加错误 pvc-xxx卷已经专门连接到一个节点,不能连接到另一个

全部在GKE上运行。我有一个以前的集群,问题从未发生过。我在创建这个新群集时重复使用了相同的磁盘 - 不确定它是否相关

这里是完整的yaml配置文件(我将相关的代码部分注释为突出显示它,但不是在有效使用时)



如果有明显的解决方法,请事先致谢 应该会发生。



您在 gcePersistentDisk 。 github.com/deesx/cb2b4180cc066c2e08d5cd0fbad06323#file-volume-ymlrel =nofollow noreferrer> PV / PVC定义 accessMode ReadWriteOnce - 这意味着这个PV只能连接到一个节点(这里强调节点,可以有多个Pod在同一个节点上使用相同的PV运行)。关于这一点你可以做的事情不多。 gcePersistentDisk 与远程块设备类似,无法同时将其安装在多个节点上(除非只读) 。



有一个不错的表,显示哪些PV支持 ReadWriteMany (即同时在多个节点上写入访问权限) :
$ b


重要!一次只能使用一种访问模式安装卷,即使它支持许多。例如,一个GCEPersistentDisk可以作为ReadWriteOnce由单个节点装载,或者由ReadOnlyMany装载到许多节点,但不能同时装入。



The problem seems to have been solved a long time ago, as the answer and the comments does not provide real solutions, I would like to get some help from experienced users

The error is the following (when describing the pod, which keeps on the ContainerCreating state) :

Multi-Attach error for volume "pvc-xxx" Volume is already exclusively attached to one node and can't be attached to another 

This all run on GKE. I had a previous cluster, and the problem never occured. I have reused the same disk when creating this new cluster — not sure if it is related

Here is the full yaml config files (I'm leaving the concerned code part commented as to highlight it; it is not when in effective use)

Thanks in advance if obvious workarounds

解决方案

Based on your description what you are experiencing is exactly what is supposed to happen.

You are using gcePersistentDisk in your PV/PVC definition. The accessMode is ReadWriteOnce - this means that this PV can only be attached to a single Node (stressing Node here, there can be multiple Pods running on the same Node using the same PV). There is not much you can do about this; gcePersistentDisk is like a remote block device, it's not possible to mount it on multiple Nodes simultaneously (unless read only).

There is a nice table that shows which PVs support ReadWriteMany (that is, write access on multiple Nodes at the same time):

Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time.

这篇关于针对卷的GKE / Multi-Attach错误的卷声明已被专门附加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆