我可以将单个GCE磁盘的多个分区安装到Pod吗? [英] Can I mount multiple partitions of a single GCE disk to a Pod?
问题描述
我想使用一个 google计算引擎 磁盘,然后将其安装到 Kubernetes Google Container Engine .
I'd like use a single google compute engine disk and mount it to multiple places a Kubernetes Google Container Engine.
我想知道使用persistentVolumeClaim
是否可以工作,但是我希望能工作的是能够装入同一磁盘的两个分区:
I'm wondering if using persistentVolumeClaim
would work, but what I did expect to work is being able to mount two partitions of the same disk:
...
volumes:
- name: database
gcePersistentDisk:
pdName: dist-1
fsType: ext4
partition: 1
readOnly: true
- name: media
gcePersistentDisk:
pdName: disk-1
fsType: ext4
partition: 2
readOnly: true
分别安装它们中的任何一个都可以,但是尝试同时安装它们会出现错误:
Mounting either of them separately works, but trying to mount both gives an error:
FailedMount Unable to mount volumes for pod "frontend-ni7uf_foo": Could not attach GCE PD "disk-1". Timeout waiting for mount paths to be created.
从技术上讲,我可以在单个实例上手动安装两个分区.
Technically I can manually mount both partitions on a single instance.
我想知道这是否是一个错误,是否还有其他解决方案(除了拥有多个磁盘之外)?
I'm wondering if it's a bug and if there is another solution for that (outside of having multiple disks)?
推荐答案
类似,Google Container Engine在两个方面都要求readOnly
:
Looks like it Google Container Engine requires readOnly
on both:
containers:
- volumeMounts:
- readOnly: true
volumes:
- gcePersistentDisk:
readOnly: true
这篇关于我可以将单个GCE磁盘的多个分区安装到Pod吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!