Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to practice NFS PersistentVolume

Shulou Source: shulou.com Published: 2022-06-01 00:57:06 09月22日 Update

How to carry out NFS PersistentVolume practice, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

As a preparation, we have set up a NFS server on the k8s-master node with the directory / nfsdata:

Create a PV mypv1 below, and the configuration file nfs-pv1.yml is as follows:

STATUS is Available, which means that mypv1 is ready and can be applied for by PVC.

Next, create PVC mypvc1, and the configuration file nfs-pvc1.yml is as follows:

From the output of kubectl get pvc and kubectl get pv, you can see that mypvc1 has been Bound to mypv1, and the application is successful.

Next, you can use storage in Pod, and the Pod configuration file pod1.yml is as follows:

Verify that PV is available:

As you can see, the file / mydata/hello created in Pod has indeed been saved to the NFS server directory / nfsdata/pv1.

If you no longer need to use PV, you can delete PVC to recycle PV.

After reading the above, have you mastered the method of how to practice NFS PersistentVolume? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: File configuration practice next content method more server directory problem service success helpless for this reason skill article experience node Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei Shulou Tech Info macOS MariaDB