<p>My Kubernetes deployment has a PVC attached, and it has 3 replicas. I was trying to understand what it actually means. 3 replicas are all on different nodes, in different zones, but the pods can access the same piece of storage at the same time.</p>
<p>So my question is that where the physical disk locates? If it's with say node 1 in zone 1, then how does node in zone 2 access it without network? If it requires network, then it's possible that the data will not be synced? What if I have a worker node in Dallas and another one in London? Are they still able to access the same PV and update at the same time?</p>
<p>I was trying to use it to store some cache data because looks like it's accessible to all the pods, but there were too many questions in my mind that I can't get over. Thanks for any insightful answers in advance.</p>

<p>Kubernetes <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">PersistentVolume</a> is an abstraction. PV works with different storage system and they may have different properties. E.g. the <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/" rel="nofollow noreferrer">Storage Class</a> you are using may hint if it is available in all your Zones in a cloud Region or only one Zone. Also <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">Access Mode</a> of your PersistentVolume affect wether all your pods can access the volume concurrently from different Nodes or not.</p>
<p>In most cases, a PV is only available in a single Zone and on a single Node at a time. But e.g. PVs backed by e.g. NFS may be available from multiple Nodes and Zones.</p>
<p>When using <code>PersistentVolume</code> from a <code>Deployment</code>, all your replicas refers to the <em>same</em> volume. Depending on your storage system, this may be problematic, if using more than one replica.</p>
<p>When using <code>StatefulSet</code>, all your replicas refers to their own <em>unique</em> volume.</p>
<p>For using <em>cache</em> in a distributed environment like Kubernetes, I would consider using something that is distributed and accessible over the network, e.g. <a href="https://redis.io/" rel="nofollow noreferrer">Redis</a>.</p>
<blockquote>
<p>where the physical disk locates?</p>
</blockquote>
<p>This depends on what storage system is configured for your <em>Storage Class</em>, but usually it is something located on another server, e.g. <a href="https://aws.amazon.com/ebs/" rel="nofollow noreferrer">AWS EBS</a> or <a href="https://cloud.google.com/persistent-disk" rel="nofollow noreferrer">Google Persistent Disk</a></p>
<blockquote>
<p>If it's with say node 1 in zone 1, then how does node in zone 2 access it without network? If it requires network, then it's possible that the data will not be synced?</p>
</blockquote>
<p>PVs that are available in multiple Zones are typically synced synchronously (e.g. a trade off with higher write latency), but only to another nearby located Zone. If you need geo-replicated data, it would be better to consider something asynchronous, e.g. <a href="https://kafka.apache.org/" rel="nofollow noreferrer">Apache Kafka</a>.</p>
