对齐文件规范

This commit is contained in:
2026-03-27 16:58:41 +08:00
parent 231b6713c4
commit 31709425e2
235 changed files with 5433 additions and 2850 deletions

View File

@@ -0,0 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nfs-direct-demo
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: nfs-direct-demo
template:
metadata:
labels:
app: nfs-direct-demo
spec:
containers:
- name: app
image: nginx:alpine
volumeMounts:
- name: nfs-data
mountPath: /usr/share/nginx/html
volumes:
- name: nfs-data
nfs:
server: <NFS_SERVER_IP>
path: <NFS_EXPORT_PATH_OR_SUBDIR>

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-dynamic-pvc-demo
namespace: default
spec:
accessModes:
- ReadWriteMany
storageClassName: nfs-client
resources:
requests:
storage: 5Gi

View File

@@ -0,0 +1,28 @@
# 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