feat: init commit

This commit is contained in:
2025-10-16 11:10:40 +08:00
commit 947a0b085f
7 changed files with 241 additions and 0 deletions

51
nfs系统创建指南.md Normal file
View File

@@ -0,0 +1,51 @@
# nfs系统创建指南
意在创建一个可共享、跨节点可用的存储系统供k3s、kubernetes使用的文件系统
**安装nfs-kernel**
```
sudo apt update
sudo apt install -y nfs-kernel-server
```
**创建共享目录**
```
mkdir -p /data/nfs
//编辑权限测试使用777生产环境可以换成特定uid
chmod -R 777 /data/nfs
```
**编辑配置文件**
向/etc/exports文件中追加以下内容
```
/data/nfs 10.42.0.0/16(rw,sync,no_subtree_check,no_root_squash)
```
参数解释:
rw允许读写
sync数据同步写入磁盘
no_subtree_check关闭子树检查提高性能
no_root_squash允许 root 用户访问;
10.42.0.0/16 是 k3s 默认 Pod 网络(可按实际调整)。
tips: 10.42.0.0/16是k3s所有pod的内部所在网段对于集群所在宿主机而言
**应用配置并启动服务**
```
sudo exportfs -ra
sudo systemctl enable nfs-server --now
```
**确认服务状态**
```
sudo systemctl status nfs-server
```