Kubernetes ReadOnlyMany + ReadWriteOnce

Kubernetes ReadOnlyMany + ReadWriteOnce

我目前正在尝试使用 Kubernetes 配置一个 Logstash 集群,我想让每个 logstash 节点通过管道将一个卷挂载为只读。然后,相同的卷将作为 read/write 安装在我可以编辑配置的单个管理实例上。

K8s 和 GCEPersistentDisk 是否可行?

我相信您所说的 Logstash 是指 ELK 集群。 Logstash 只是一个日志转发器,而不是存储端点。

不是真的。 GCEPersistentDisk 是不可能的。这是更多的 GCE 限制,您一次只能在一个实例上安装一个卷。

此外,正如您在 docs 中看到的,支持 ReadWriteOnceReadOnlyMany 但不同时支持。

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.

你可以做到这一点,但只需在单个 K8s 节点上使用单个卷,然后将你的卷分区以供同一节点上的不同 Elasticsearch pods 使用,但这会破坏分布式的目的群集。

如果您的节点位于不同的 Kubernetes 节点中并且每个节点都有一个单独的卷,Elasticsearch 工作正常。