<p>Trying to understand if a PersistentVolume created by using volumeClaimTemplates in StatefulSet would make that mount available on every worker node or only on the nodes where the pod is scheduled?</p>
<p>Here is a scenario. A StatefulSet with volumeClaimTemplates, 2 replicas, and a default storage class of type ‘kubernetes.io/vsphere-volume’ provisioner. The pods are currently deployed on node 1 &amp; 2. What happens to the data when the pods are scheduled on different nodes, let’s say node 3 &amp; 4, either during an upgrade or existing nodes being down?
Would the data written to the mount by the old pods be accessible for the new pods?
If it’s a local volume, the data is on the nodes but not sure how vsphereVolume works in this case.</p>
<p>I am assuming that the persistent volume provisioner, in this case, vsphereVolume makes the mount/data available to all the nodes, but couldn't confirm if that's the case.
I will try to test this with a MySQL or PostgreSQL.</p>
<p>Thanks</p>

cnu
<p>I see it in the documentation, at the end of <a href="https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#writing-to-stable-storage" rel="nofollow noreferrer">Writing to Stable Storage</a> section, somehow missed this earlier.</p>
<blockquote>
<p>Even though web-0 and web-1 were rescheduled, they continue to serve their hostnames because the PersistentVolumes associated with their PersistentVolumeClaims are remounted to their volumeMounts. No matter what node web-0and web-1 are scheduled on, their PersistentVolumes will be mounted to the appropriate mount points.</p>
</blockquote>
<p>Based on StatefulSet page it's clear that all the nodes will have access to the mount/data. If a pod is deleted and re-created it's scheduled on the same node.</p>
