<p>I would like to setup a Kubernetes cluster as follows:
<a href="https://i.stack.imgur.com/sP75Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sP75Z.png" alt="enter image description here" /></a></p>
<p>Kubernetes will be installed on top of VMs depicted in pink.</p>
<p>I am going to use statefulsets or replicasets to deploy Jenkins master and Jenkins executors. I would like that the workspace folder on the Jenkins master to be always in sync on all replicas in eventuality of losing any worker VMs or server.</p>
<p>Can be achieved using internal mechanisms of replicasets or statefulsets or is any other way of keeping the workspace in sync?</p>
<p>Thank you,</p>
<p>Albert</p>

Albert
<p>You can't just assume that <code>statefulset</code> will do the job for you. You can configure a NFS server and point the PV to it and bind your PVC to this PV and your STS can point to your PVC. So, basically</p>
<pre><code>STS -&gt; PVC -&gt; PV -&gt; NFS Server
</code></pre>
<p>So, even if one worker node goes down, it won't impact the others.</p>
