CSIDriver
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSIDriver
CSIDriver 捕获有关部署在集群上的容器存储接口 (CSI) 卷驱动程序的信息。Kubernetes 附加分离控制器使用此对象来确定是否需要附加。Kubelet 使用此对象来确定是否需要在挂载时传递 Pod 信息。CSIDriver 对象是非命名空间的。
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata (ObjectMeta)
标准对象元数据。metadata.Name 指示此对象所指的 CSI 驱动程序的名称;它必须与 CSI GetPluginName() 调用为该驱动程序返回的名称相同。驱动程序名称必须不超过 63 个字符,以字母数字字符 ([a-z0-9A-Z]) 开头和结尾,中间用连字符 (-)、点 (.) 和字母数字字符分隔。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (CSIDriverSpec), required
spec 表示 CSI 驱动程序的规范。
CSIDriverSpec
CSIDriverSpec 是 CSIDriver 的规范。
attachRequired (boolean)
attachRequired 指示此 CSI 卷驱动程序需要附加操作(因为它实现了 CSI ControllerPublishVolume() 方法),并且 Kubernetes 附加分离控制器应该调用附加卷接口,该接口检查 volumeattachment 状态并等待卷附加完成,然后再继续挂载。CSI 外部附加器与 CSI 卷驱动程序协调,并在附加操作完成后更新 volumeattachment 状态。如果 CSIDriverRegistry 功能网关已启用并且该值指定为 false,则将跳过附加操作。否则,将调用附加操作。
此字段是不可变的。
fsGroupPolicy (string)
fsGroupPolicy 定义在挂载之前,底层卷是否支持更改卷的所有权和权限。有关更多详细信息,请参阅特定 FSGroupPolicy 值。
此字段是不可变的。
默认为 ReadWriteOnceWithFSType,它将检查每个卷以确定 Kubernetes 是否应该修改卷的所有权和权限。使用默认策略,只有在定义了 fstype 且卷的访问模式包含 ReadWriteOnce 时,才会应用定义的 fsGroup。
podInfoOnMount (boolean)
podInfoOnMount 指示此 CSI 卷驱动程序在挂载操作期间是否需要其他 Pod 信息(如 PodName、PodUID 等),如果设置为 true。如果设置为 false,则不会在挂载时传递 Pod 信息。默认为 false。
CSI 驱动程序在驱动程序部署中指定 podInfoOnMount。如果为 true,Kubelet 将在 CSI NodePublishVolume() 调用中将 Pod 信息作为 VolumeContext 传递。CSI 驱动程序负责解析和验证作为 VolumeContext 传递的信息。
如果 podInfoOnMount 设置为 true,则将传递以下 VolumeConext。此列表可能会增长,但将使用前缀。 "csi.storage.k8s.io/pod.name": pod.Name "csi.storage.k8s.io/pod.namespace": pod.Namespace "csi.storage.k8s.io/pod.uid": string(pod.UID) "csi.storage.k8s.io/ephemeral": "true" 如果卷是由 CSIVolumeSource 定义的临时内联卷,否则为 "false"
"csi.storage.k8s.io/ephemeral" 是 Kubernetes 1.16 中的新功能。它仅适用于支持 "Persistent" 和 "Ephemeral" VolumeLifecycleMode 这两种模式的驱动程序。其他驱动程序可以使 Pod 信息保持禁用和/或忽略此字段。由于 Kubernetes 1.15 不支持此字段,因此驱动程序在部署到此类集群时只能支持一种模式,并且部署确定哪种模式,例如通过驱动程序的命令行参数。
此字段是不可变的。
requiresRepublish (boolean)
requiresRepublish 指示 CSI 驱动程序希望定期调用
NodePublishVolume
以反映挂载卷的任何可能更改。此字段默认为 false。注意:在成功进行初始 NodePublishVolume 调用后,后续对 NodePublishVolume 的调用应该只更新卷的内容。运行中的容器将无法看到新的挂载点。
seLinuxMount (boolean)
seLinuxMount 指定 CSI 驱动程序是否支持 "-o context" 挂载选项。
当 "true" 时,CSI 驱动程序必须确保此 CSI 驱动程序提供的所有卷都可以使用不同的
-o context
选项分别挂载。这对于将卷作为块设备上的文件系统或作为独立共享卷提供的存储后端来说很常见。当挂载在已显式设置 SELinux 上下文的 Pod 中使用的 ReadWriteOncePod 卷时,Kubernetes 将使用 "-o context=xyz" 挂载选项调用 NodeStage/NodePublish。将来,它可能会扩展到其他卷访问模式。无论如何,Kubernetes 将确保该卷只使用单个 SELinux 上下文挂载。当 "false" 时,Kubernetes 不会将任何特殊的 SELinux 挂载选项传递给驱动程序。这对于表示较大共享文件系统的子目录的卷来说很常见。
默认为 "false"。
storageCapacity (boolean)
storageCapacity 指示 CSI 卷驱动程序是否希望 Pod 调度考虑驱动程序部署通过创建具有容量信息的 CSIStorageCapacity 对象来报告的存储容量,如果设置为 true。
部署驱动程序时,可以立即启用检查。在这种情况下,预配使用延迟绑定的新卷将暂停,直到驱动程序部署发布一些合适的 CSIStorageCapacity 对象。
或者,驱动程序可以在未设置或为 false 的情况下部署,并且在发布了存储容量信息后可以稍后将其翻转。
此字段在 Kubernetes <= 1.22 中是不可变的,现在是可变的。
tokenRequests ([]TokenRequest)
原子:在合并期间将被替换
tokenRequests 指示 CSI 驱动程序需要它正在挂载卷的 Pod 的服务帐户令牌来执行必要的身份验证。Kubelet 将在 CSI NodePublishVolume 调用中的 VolumeContext 中传递令牌。CSI 驱动程序应该解析和验证以下 VolumeContext: "csi.storage.k8s.io/serviceAccount.tokens": { "<audience>": { "token": <token>, "expirationTimestamp": <expiration timestamp in RFC3339>, }, ... }
注意:每个 TokenRequest 中的受众应该是不同的,并且最多有一个令牌为空字符串。要收到过期后的新令牌,可以使用 RequiresRepublish 定期触发 NodePublishVolume。
tokenRequests.audience (string), required
audience 是 "TokenRequestSpec" 中令牌的预期受众。它将默认为 kube apiserver 的受众。
tokenRequests.expirationSeconds (int64)
expirationSeconds 是 "TokenRequestSpec" 中令牌的有效期。它与 "TokenRequestSpec" 中 "ExpirationSeconds" 具有相同的默认值。
volumeLifecycleModes ([]string)
设置:合并期间将保留唯一值
volumeLifecycleModes 定义此 CSI 卷驱动程序支持哪些类型的卷。如果列表为空,则默认为 "Persistent",这是 CSI 规范中定义的用法,并在 Kubernetes 中通过通常的 PV/PVC 机制实现。
另一种模式是 "Ephemeral"。在这种模式下,卷是在 Pod 规范中使用 CSIVolumeSource 内联定义的,并且它们的生存期与该 Pod 的生存期相关联。驱动程序必须了解这一点,因为它只会在这种卷上收到 NodePublishVolume 调用。
有关实现此模式的更多信息,请参阅 https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html 驱动程序可以支持这些模式中的一种或多种,并且将来可能会添加更多模式。
此字段为 Beta 版。此字段是不可变的。
CSIDriverList
CSIDriverList 是 CSIDriver 对象的集合。
apiVersion: storage.k8s.io/v1
kind: CSIDriverList
metadata (ListMeta)
标准列表元数据 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CSIDriver), required
items 是 CSIDriver 列表
操作
get
读取指定的 CSIDriver
HTTP 请求
GET /apis/storage.k8s.io/v1/csidrivers/{name}
参数
name (在路径中): string, required
CSIDriver 的名称
pretty (在查询中): string
响应
200 (CSIDriver): OK
401: 未授权
list
列出或监视 CSIDriver 类型的对象
HTTP 请求
GET /apis/storage.k8s.io/v1/csidrivers
参数
allowWatchBookmarks (在查询中): boolean
continue (在查询中): string
fieldSelector (在查询中): string
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
watch (在查询中): boolean
响应
200 (CSIDriverList): OK
401: 未授权
create
创建 CSIDriver
HTTP 请求
POST /apis/storage.k8s.io/v1/csidrivers
参数
body: CSIDriver, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIDriver): OK
201 (CSIDriver): 已创建
200 (CSIDriver): 已接受
401: 未授权
update
替换指定的 CSIDriver
HTTP 请求
PUT /apis/storage.k8s.io/v1/csidrivers/{name}
参数
name (在路径中): string, required
CSIDriver 的名称
body: CSIDriver, required
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
响应
200 (CSIDriver): OK
201 (CSIDriver): 已创建
401: 未授权
patch
部分更新指定的 CSIDriver
HTTP 请求
PATCH /apis/storage.k8s.io/v1/csidrivers/{name}
参数
name (在路径中): string, required
CSIDriver 的名称
body: 补丁,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (查询中): 布尔值
pretty (在查询中): string
响应
200 (CSIDriver): OK
201 (CSIDriver): 已创建
401: 未授权
delete
删除 CSIDriver
HTTP 请求
DELETE /apis/storage.k8s.io/v1/csidrivers/{name}
参数
name (在路径中): string, required
CSIDriver 的名称
body: 删除选项
dryRun (在查询中): string
gracePeriodSeconds (查询中): 整数
pretty (在查询中): string
propagationPolicy (查询中): 字符串
响应
200 (CSIDriver): OK
200 (CSIDriver): 已接受
401: 未授权
deletecollection
删除 CSIDriver 集合
HTTP 请求
DELETE /apis/storage.k8s.io/v1/csidrivers
参数
body: 删除选项
continue (在查询中): string
dryRun (在查询中): string
fieldSelector (在查询中): string
gracePeriodSeconds (查询中): 整数
labelSelector (在查询中): string
limit (在查询中): integer
pretty (在查询中): string
propagationPolicy (查询中): 字符串
resourceVersion (在查询中): string
resourceVersionMatch (在查询中): string
sendInitialEvents (在查询中): boolean
timeoutSeconds (在查询中): integer
响应
200 (状态): 正常
401: 未授权
此页面自动生成。
如果您打算报告此页面的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。