> For the complete documentation index, see [llms.txt](https://docs.niewx.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.niewx.cn/20200807tke-zhong-gua-zai-wen-jian-dao-cfs-zi-mu-lu.md).

# TKE中挂载文件到CFS子目录

本次我们来讲如何在TKE容器中多个pod挂载文件到文件服务器CFS不同的子目录

## 首先创建好CFS文件服务器

登录CFS控制台，创建一个文件系统

![upload-image](/files/-MN2J9Ql422J-8NTibgl)

## 创建CFS子目录

如何创建CFS的子目录呢，这里我们找一个可以访问cfs内网ip的服务器，先将cfs的根目录下挂载到/root/cfs，然后在/root/nfs下创建2个子目录tke和tke-1，注意创建完目录后记得解挂/root/nfs这个目录，对应的子目录在文件系统中已经创建好了。

```
[root@VM-1-5-centos ~]# mkdir nfs
[root@VM-1-5-centos nfs]# sudo mount -t nfs -o vers=4.0 1.1.1.1:/ /root/nfs
[root@VM-1-5-centos nfs]# mkdir tke
[root@VM-1-5-centos nfs]# mkdir tke-1
[root@VM-1-5-centos nfs]# cd
[root@VM-1-5-centos ~]# umount /root/nfs
```

corresponding condition of pod readiness gate "platform.tkex/InPlace-Update-Ready" does not exist., the status of pod readiness gate "cloud.tencent.com/load-balancer-backendgroup-ready" is not "True", but False

## TKE中创建StorageClass

登录tke，在集群中新建sc

![upload-image](/files/-MN2J9QmvHGAYS74rHSh)

## 创建PV

这里我们分别为tke和tke-1创建一个pv

![upload-image](/files/-MN2J9Qn72cT-AVxD1B2)

![upload-image](/files/-MN2J9QqraBHeHdknEOs)

## 创建PVC

我们创建2个pvc关联上一步创建的pv

![upload-image](/files/-MN2J9Qrm4bPhM4tIgPb)

![upload-image](/files/-MN2J9QsmbS6Y-_jCYfu)

## 挂载PVC

我们创建2个测试的nginx镜像pod来挂载2个pvc

![upload-image](/files/-MN2J9QtrqexV9Zj7reN)

![upload-image](/files/-MN2J9QuTBZhnm5i4bQV)

## 验证

查看pod启动成功，挂载成功，在CFS中查看也能看到对应的2条挂载信息

![upload-image](/files/-MN2J9QvgzlHeQV9UROi)

![upload-image](/files/-MN2J9QwbZVbzGSaWys7)
