第151篇NFS PersistentVolume上一节我们介绍了 PV 和 PVC,本节通过 NFS 实践。作为准备工作,我们已经在 k8s-master 节点上搭建了一个 NFS 服务器,目录为 /nfsdata:下面创建一个 PV mypv1,配置文件 nfs-pv1.yml 如下:① capacity 指定 PV 的容量为 1G。② accessModes 指定访问模式为 ReadWriteOnce,支持的访问模式有:ReadWriteOnce – PV 能以 read-write 模式 mount 到单个节点。ReadOnlyMany – PV 能以 read-only 模式 mount 到多个节点。ReadWriteMany – PV 能以 read-write 模式 mount 到多个节点。③ persistentVolumeReclaimPolicy 指定当 PV 的回收策略为 Recycle,支持的策略有:Retain – 需要管理员手工回收。Recycle – 清除 PV 中的数据,效果相当于执行 rm -rf /thevolume/*。Delete – 删除 Storage Provider 上的对应存储资
………………………………