gpt4 book ai didi

kubernetes - PV和PVC中需要storageClassName

转载 作者:行者123 更新时间:2023-12-05 04:25:27 26 4
gpt4 key购买 nike

我创建的 PV 如下:

apiVersion: v1
kind: PersistentVolume
metadata:
name: foo-pv
spec:
storageClassName: "my-storage"
claimRef:
name: foo-pvc
namespace: foo

为什么要在PV中给出storageClassName? Storage类创建PV时,为什么要在PV中赋予storageClassName?

谁能帮我理解一下?

最佳答案

根据 Kubernetes 官方文档:

为什么要在PV中给出storageClassName?

Each StorageClass contains the fields provisioner, parameters, andreclaimPolicy, which are used when a PersistentVolume belonging tothe class needs to be dynamically provisioned.

The name of a StorageClass object is significant, and is how users canrequest a particular class. Administrators set the name and otherparameters of a class when first creating StorageClass objects, andthe objects cannot be updated once they are created.

Storage类创建PV时,为什么要在PV中赋予storageClassName?

A PersistentVolume (PV) is a piece of storage in the cluster that hasbeen provisioned by an administrator or dynamically provisioned usingStorage Classes. It is a resource in the cluster just like a node is a cluster resource.

Cluster administrators need to be able to offer a variety ofPersistentVolumes that differ in more ways than size and access modes,without exposing users to the details of how those volumes areimplemented. For these needs, there is the StorageClass resource.

想了解更多Storage类资源,请关注this link , 或 this one了解有关持久卷的更多信息。

关于kubernetes - PV和PVC中需要storageClassName,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73261616/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com