Kubernetes ReadOnlyMany + ReadWriteOnce

11/30/2018

I'm currently trying to configure a Logstash cluster with Kubernetes and I would like to have each of the logstash nodes mount a volume as read-only with the pipelines. This same volume would then be mounted as read/write on a single management instance where I could edit the configs.

Is this possible with K8s and GCEPersistentDisk?

-- CodeCorrupt
gce-persistent-disk
kubernetes

1 Answer

12/1/2018

By Logstash I believe you mean an ELK cluster. Logstash is just a log forwarder and not an endpoint for storage.

Not really. It's not possible with a GCEPersistentDisk. This is more of GCE limitation where you can only mount a volume on an instance at a time.

Also, as you can see in the docs supports the ReadWriteOnce and the ReadOnlyMany but not at the same time.

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.

You could achieve this but just using a single volume on a single K8s node and then partition your volume to be used by different Elasticsearch pods on the same node but this would defeat the purpose of having a distributed cluster.

Elasticsearch works fine if you have your nodes in different Kubernetes nodes and each of them has a separate volume.

-- Rico
Source: StackOverflow