Files
Deploy-Laboratory/ansible/files/03-06-nfs-demo/nfs-pv-pvc-demo.yaml
jack 8c43761962 feat: 按 doc_id 重组 ansible/files 与验证框架
- ansible/files 改为与文档 XX-YY 对齐的目录结构,更新相关 playbook 路径
- 新增 scripts/verify.sh 与 ansible/playbooks/verify/*.yml,移除单体 verify-matrix.yml
- 补充 docs/00-02 矩阵状态、00-05 验证框架与流程、00-04 环境与 ylc65 工作机说明
- 增加 k3s 存储准备、Longhorn、local-path 等 playbook 与辅助脚本

Made-with: Cursor
2026-03-26 07:01:14 +08:00

29 lines
1.2 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: <NFS_SERVER_IP> # NFS 服务器地址示例192.168.2.22;应用前必须替换)
path: <NFS_EXPORT_PATH> # NFS 导出目录(示例:/sdcard应用前必须替换
---
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