我可以将单个GCE磁盘的多个分区安装到Pod吗?

Wer*_*ght 3 kubernetes google-kubernetes-engine

我想使用单个谷歌计算引擎 磁盘并将其安装到Kubernetes Google容器引擎的多个位置.

我想知道使用persistentVolumeClaim是否可行,但我所期望的是能够安装同一磁盘的两个分区:

  ...
  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
Run Code Online (Sandbox Code Playgroud)

单独安装其中任何一个都有效,但尝试同时安装它们会产生错误:

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.
Run Code Online (Sandbox Code Playgroud)

从技术上讲,我可以在一个实例上手动安装两个分区.

我想知道它是否是一个错误,如果有另一个解决方案(在有多个磁盘之外)?

Wer*_*ght 5

看起来谷歌容器引擎readOnly在两者上都需要:

containers:
  - volumeMounts:
      - readOnly: true
volumes:
  - gcePersistentDisk:
      readOnly: true
Run Code Online (Sandbox Code Playgroud)