<p>I need a piece of advice / recommendation / link to tutorial.</p>

<p>I am designing a kubernetes cluster and one of the projects is a Wordpress site with lots of pictures (photo blog).</p>

<p>I want to be able to tear down and re-create my cluster within an hour, so all "persistent" pieces need to be hosted outside of cluster (say, separate linux instance).</p>

<p>It is doable with database - I will just have a MySQL server running on that machine and will update WP configs accordingly.</p>

<p>It is not trivial with filesystem storage. I am looking at Kubernetes volume providers, specifically NFS. I want to setup NFS server on a separate machine and have each WP pod use that NFS share through volume mechanism. In that case, I can rebuild my cluster any time and data will be preserved. Almost like database access, but filesystem.</p>

<p>The questions are the following. Does this solution seem feasible? Is there any better way to achieve same goal? Does Kubernetes NFS plugin support the functionality I need? What about authorization? </p>

<p>so I am using a very similar strategy for my cluster where all my PVC are placed on a standalone VM instance with a static IP and which has an NFS-server running and a simple nfs-client-provisioner helm chart on my cluster.</p>

<p>So here what I did : </p>

<ol>
<li>Created a server(Ubuntu) and installed the NFS server on it. Reference <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04" rel="nofollow noreferrer">here</a> </li>
<li><p>Install a helm chart/app for nfs-client-proviosner with parameters.</p>

<p><code>nfs.path = /srv ( the path on server which is allocated to NFS and shared)</code> </p>

<p><code>nfs.server = xx.yy.zz.ww ( IP of my NFS server configured above)</code></p></li>
</ol>

<p>And that's it the chart creates an <code>nfs-client</code> storage class which you can use to create a PVC and attach to your pods. </p>

<p><strong>Note</strong> - Make sure to configure the <code>/etc/exports</code> file on the NFS server to look like this as mentioned in the reference digital ocean document.</p>

<p><code>/srv kubernetes_node_1_IP(rw,sync,no_root_squash,no_subtree_check)</code></p>

<p><code>/srv kubernetes_node_2_IP(rw,sync,no_root_squash,no_subtree_check)</code>
... and so on.</p>

<p>I am using the PVC for some php and laravel applications, seem to work well without any considerable delays. Although you will have to check for your specific requirements. HTH.</p>
