<p>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.</p>

<p>Is this possible with K8s and GCEPersistentDisk?</p>

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

<p>Not really. It's not possible with a <a href="https://kubernetes.io/docs/concepts/storage/volumes/#gcepersistentdisk" rel="nofollow noreferrer"><code>GCEPersistentDisk</code></a>. This is more of GCE limitation where you can only mount a volume on an instance at a time. </p>

<p>Also, as you can see in the <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">docs</a> supports the <code>ReadWriteOnce</code> and the <code>ReadOnlyMany</code> but not at the same time.</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>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.</p>

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