Files
Deploy-Laboratory/ansible/files/nfs-demo/nfs-pv-pvc-demo.yaml
jack be97836e0d chore: 清理调试脚本并收敛到 Ansible 流程
移除已废弃的调试/验证脚本与空目录,统一文档与脚本说明到 ansible-playbook 的部署方式,避免失效引用和误用路径。

Made-with: Cursor
2026-03-23 19:18:55 +08:00

28 lines
1.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# docs/03-06-k3s-使用nfs存储.md — 按环境修改 server/path
apiVersion: v1 # PV/PVC 使用的核心 API 版本
kind: PersistentVolume # 资源类型:持久卷(集群级)
metadata: # PV 元信息
name: nfs-pv-demo # PV 名称
spec: # PV 规格
capacity: # 容量声明
storage: 20Gi # PV 总容量
accessModes: # 访问模式列表
- ReadWriteMany # RWX多节点可读写
persistentVolumeReclaimPolicy: Retain # 回收策略:删除 PVC 后保留底层数据
nfs: # 存储后端NFS
server: 192.168.2.22 # NFS 服务器地址
path: /data/nfs # NFS 导出目录
---
apiVersion: v1 # PVC 使用的核心 API 版本
kind: PersistentVolumeClaim # 资源类型:持久卷声明
metadata: # PVC 元信息
name: nfs-pvc-demo # PVC 名称
namespace: default # PVC 所在命名空间
spec: # PVC 规格
accessModes: # 访问模式要求
- ReadWriteMany # 申请 RWX 访问模式
resources: # 资源请求
requests: # 配额请求
storage: 5Gi # 申请容量
volumeName: nfs-pv-demo # 显式绑定到指定 PV