gpt4 book ai didi

google-cloud-platform - 如何在Replication Controller中使用永久磁盘?谷歌云/kubernetes

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

我想在复制 Controller 中使用永久磁盘,但是如果我使用gcePersistentDisk,则控制台会向我返回错误

ReadOnly must be true for replicated pods > 1, as GCE PD can only be mounted on multiple machines if it is read-only.

最佳答案

从错误消息和从docs:

A feature of PD is that they can be mounted as read-only by multiple consumers simultaneously. This means that you can pre-populate a PD with your dataset and then serve it in parallel from as many pods as you need. Unfortunately, PDs can only be mounted by a single consumer in read-write mode - no simultaneous readers allowed.



因此,您有两种方法可以解决此问题:
  • 将您的ReplicationController中的replicas设置为1
  • 将音量设为readOnly: true
    gcePersistentDisk:
    pdName: my-data-disk
    fsType: ext4
    readOnly: true
  • 关于google-cloud-platform - 如何在Replication Controller中使用永久磁盘?谷歌云/kubernetes,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34567035/

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