> ## Content Index
> Fetch the complete content index at: https://lucent.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# 使用Rancher-Ui为应用配置数据卷
- URL: https://lucent.blog/shi-yong-rancher-uiwei-ying-yong-pei-zhi-shu-ju-juan/
- Published: 2021-11-17T07:17:22.000Z
- Updated: 2026-08-21T00:49:56.000Z
- Author: Lucent
- Tags: Docker, K8s

### 说明

使用Docker时往往需要将容器内部的某些文件持久化，例如日志，在使用K8s部署时，可以选择使用PVC映射这些文件

### 方法(以Nginx为例)

![image-20211027102544185](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211027102544185.png)

![image-20211027102612168](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211027102612168.png)

![image-20211027102626184](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211027102626184.png)

![image-20211027102718207](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211027102718207.png)

| 项目   | 解释        |
| ---- | --------- |
| PVC  | 需要挂载的PVC  |
| 容器路径 | 应用容器内部的路径 |

服务启动之后可以登陆服务器，查看相关路径下是否有容器内映射出来的文件

![image-20211027123609185](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211027123609185.png)

说明已经成功！