Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to practice NFS PersistentVolume

2025-02-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report