问题描述
是否可以将现有的PVC从ReadWriteOnce更改为ReadWriteMany,而无需重新创建它?我有一个现有的数据库Pod,并且由于某种原因文件系统已变为只读状态.我想将另一个吊舱连接到PVC进行查看.
Is it possible to change an existing PVC to ReadWriteMany from ReadWriteOnce without recreating it? I have an existing database pod and the file system has become read only for some reason. I wanted to connect another pod to the PVC to look at it.
推荐答案
您可以这样做,而无需更改PVC. ReadWriteOnce
中的 Once 与访问PVC的Pods数量无关,而与访问PVC的节点数量无关.
You can do so without changing the PVC. The Once in ReadWriteOnce
is not about the number of Pods accessing the PVC but about the number of Nodes accessing it.
创建另一个安装相同PVC的Pod并设置nodeSelector
(使用主机名),以便在现在已安装PVC的同一节点上进行调度.
Create another Pod mounting the same PVC and set nodeSelector
(use hostname) so it schedules on the same node where the PVC is mounted now.
或者,将SSH SSH到已经为Pod安装了PVC的节点上. kubectl describe ...
如果您有很多坐骑,则会为您提供所需的ID.
Alternatively SSH into the node that has the PVC mounted already for the Pod. kubectl describe ...
gives you the id you are looking for if you have many mounts.
这篇关于kubernetes将PVC从ReadWriteOnce更改为ReadWriteMany的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!