> ## 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配置K8s集群PVC
- URL: https://lucent.blog/shi-yong-rancher-uipei-zhi-k8sji-qun-pvc/
- Published: 2021-11-17T07:12:58.000Z
- Updated: 2026-08-21T00:49:56.000Z
- Author: Lucent
- Tags: Docker, K8s

### PV概述

PersistentVolume (PV)是集群中由管理员提供或使用存储类动态提供的一块存储。它是集群中的资源，就像节点是集群资源一样。

PV是与Volumes类似的卷插件，但其生命周期与使用PV的任何单个Pod无关。由此API对象捕获存储的实现细节，不管是NFS、iSCSI还是特定于云提供商的存储系统。

### PVC概述

PVC 的全称是：PersistentVolumeClaim（持久化卷声明），PVC 是用户存储的一种声明，PVC 和 Pod 比较类似，Pod 消耗的是节点，PVC 消耗的是 PV 资源，Pod 可以请求 CPU 和内存，而 PVC 可以请求特定的存储空间和访问模式。对于真正使用存储的用户不需要关心底层的存储实现细节，只需要直接使用 PVC 即可。

### 为集群配置PV

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

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

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

| 项目   | 解释                       |
| ---- | ------------------------ |
| 名称   | 一个易于辨识所属项目的名字            |
| 卷插件  | 使用的协议，NFS                |
| 容量   | 给该PV分配的最大容量              |
| 路径   | NFS服务器上的路径（/nfsdata下的路径） |
| 服务器  | 刚刚搭建的NFS服务器内网ip          |
| 访问模式 | 该PV拥有的权限                 |

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

### 为集群配置PVC

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

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

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

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

| 项目   | 解释                        |
| ---- | ------------------------- |
| 名称   | 一个易于区别的名字                 |
| 命名空间 | 所属命名空间，相同命名空间的应用才能访问 该PVC |
| 持久卷  | 就是刚刚创建的PV                 |