kubernetes工作空间中的持久卷和声明 [英] Persistent volume and claims in kubernetes workspace

查看:68
本文介绍了kubernetes工作空间中的持久卷和声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在k8的工作区中工作了大约6个月,总是想知道为什么我们需要一个持久体积(PV)和持久体积声明(PVC)?有人可以向我阐明这个概念吗?

I have been working in k8's workspace in for like 6 months now and always wonder why do we need a Persistent Volume(PV) and Persistent Volume claim(PVC)? Can anyone please make this concept clear to me?

推荐答案

PV和PVC的分离实现了Kubernetes集群管理和资源管理中的职责划分.

The separation of PV and PVCs enable a division of responsibilities in Kubernetes cluster administration and resource management.

PV是集群管理员将创建的对象,它们抽象出底层存储资源以向用户公开统一视图(即,这是您可以在这么大的空间中使用的卷").他们只关心将存储资源公开给群集,而不关心将使用谁或如何使用它.引用文档:

The PVs are objects that the cluster administrator(s) would create, and they abstract away underlying storage resources to expose an unified view to the user (ie. this is the "volume" you can use with this much space). They only care about exposing the storage resource to the cluster, and not who or how it's going to be used. Quoting the documentation:

PersistentVolume(PV)是群集中具有以下内容的一块存储 由管理员提供.它是集群中的资源 就像节点是集群资源一样. PV是体积插件,例如 卷,但生命周期独立于 使用PV.这个API物件会撷取 存储的实施,可以是NFS,iSCSI或 特定于云提供商的存储系统.

A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator. It is a resource in the cluster just like a node is a cluster resource. PVs are volume plugins like Volumes, but have a lifecycle independent of any individual pod that uses the PV. This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.

另一方面,集群用户(即那些正在部署和维护应用程序的用户)可以使用PVC动态请求和释放存储块,而不必担心基础架构.他们不必一定在乎存储来自何处或实际对其进行管理.引用文档

The PVC, on the other hand, can be used by the cluster users (ie. those who are deploying and maintaining applications) to dynamically request and release storage blocks without worrying about the underlying infrastructure. They don't necessarily have to care about from where the storage comes from or it's actually managed. Quoting the documentation

PersistentVolumeClaim(PVC)是用户存储的请求.它 类似于豆荚. Pod消耗节点资源,PVC消耗PV 资源. Pod可以请求特定级别的资源(CPU和 记忆).声明可以要求特定的大小和访问方式(例如 一次读/写或多次只读都可以安装.

A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a pod. Pods consume node resources and PVCs consume PV resources. Pods can request specific levels of resources (CPU and Memory). Claims can request specific size and access modes (e.g., can be mounted once read/write or many times read-only).

在动态预配置的部署中,Kubernetes充当PV管理的角色.用户只需请求一个PVC,Kubernetes便会配置PV并将PVC绑定到PV,从而使存储配置过程对集群用户透明.

In dynamically provisioned deployments, Kubernetes takes on the role of the PV management. Users simply request a PVC, and Kubernetes will provision the PV and bind the PVC to PV making the storage provisioning process transparent to the cluster users.

希望这会有所帮助!

这篇关于kubernetes工作空间中的持久卷和声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆