---
api_metadata:
apiVersion: "storage.k8s.io/v1"
import: "k8s.io/api/storage/v1"
kind: "CSINode"
content_type: "api_reference"
description: "CSINode 包含节点上安装的所有 CSI 驱动有关的信息。"
title: "CSINode"
weight: 9
---
`apiVersion: storage.k8s.io/v1`
`import "k8s.io/api/storage/v1"`
## CSINode {#CSINode}
CSINode 包含节点上安装的所有 CSI 驱动有关的信息。CSI 驱动不需要直接创建 CSINode 对象。
只要这些驱动使用 node-driver-registrar 边车容器,kubelet 就会自动为 CSI 驱动填充 CSINode 对象,
作为 kubelet 插件注册操作的一部分。CSINode 的名称与节点名称相同。
如果不存在此对象,则说明该节点上没有可用的 CSI 驱动或 Kubelet 版本太低无法创建该对象。
CSINode 包含指向相应节点对象的 OwnerReference。
- **apiVersion**: storage.k8s.io/v1
- **kind**: CSINode
- **metadata** (}}">ObjectMeta)
标准的对象元数据。metadata.name 必须是 Kubernetes 节点的名称。
- **spec** (}}">CSINodeSpec),必需
spec 是 CSINode 的规约。
## CSINodeSpec {#CSINodeSpec}
CSINodeSpec 包含一个节点上安装的所有 CSI 驱动规约有关的信息。
- **drivers** ([]CSINodeDriver),必需
**补丁策略:按照键 `name` 合并**
drivers 是节点上存在的所有 CSI 驱动的信息列表。如果列表中的所有驱动均被卸载,则此字段可以为空。
**CSINodeDriver 包含一个节点上安装的一个 CSI 驱动规约有关的信息。**
- **drivers.name** (string),必需
name 表示该对象引用的 CSI 驱动的名称。此字段值必须是针对该驱动由 CSI GetPluginName() 调用返回的相同名称。
- **drivers.nodeID** (string),必需
从驱动角度来看,这是节点的 nodeID。
对于未与节点共享相同命名法的存储系统,此字段使得 Kubernetes 能够与之进行通信。
例如,Kubernetes 可能将给定节点视为 "node1",但存储系统可以将同一节点视为 "nodeA"。
当 Kubernetes 向存储系统发出一条命令将一个卷挂接到特定的节点时,
它可以藉此字段使用存储系统所理解的 ID 引用节点名称,例如使用 “nodeA” 而不是 “node1”。
此字段是必需的。
- **drivers.allocatable** (VolumeNodeResources)
allocatable 表示一个节点上可供调度的卷资源。此字段处于 beta 阶段。
**VolumeNodeResources 是调度卷时所用的一组资源限制。**
- **drivers.allocatable.count** (int32)
这是一个节点上可使用的、由 CSI 驱动管理的独立卷个数的上限。
挂接并挂载到一个节点上的卷被视为被使用一次,不是两次。
相同的规则适用于同一个节点上多个 Pod 之间共享的同一个卷。
如果未指定此字段,则该节点上支持的卷数量是无限的。
- **drivers.topologyKeys** ([]string)
topologyKeys 是驱动支持的键的列表。
在集群上初始化一个驱动时,该驱动将提供一组自己理解的拓扑键
(例如 “company.com/zone”、“company.com/region”)。
在一个节点上初始化一个驱动时,该驱动将提供相同的拓扑键和值。
Kubelet 将在其自己的节点对象上将这些拓扑键暴露为标签。
当 Kubernetes 进行拓扑感知的制备时,可以使用此列表决定应从节点对象中检索哪些标签并传回驱动。
不同的节点可以使用不同的拓扑键。
如果驱动不支持拓扑,则此字段可以为空。
## CSINodeList {#CSINodeList}
CSINodeList 是 CSINode 对象的集合。
- **apiVersion**: storage.k8s.io/v1
- **kind**: CSINodeList
- **metadata** (}}">ListMeta)
标准的列表元数据。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- **items** ([]}}">CSINode),必需
items 是 CSINode 的列表。
## 操作 {#Operations}
### `get` 读取指定的 CSINode
#### HTTP 请求
GET /apis/storage.k8s.io/v1/csinodes/{name}
#### 参数
- **name** (**路径参数**): string,必需
CSINode 的名称
- **pretty** (**查询参数**): string
}}">pretty
#### 响应
200 (}}">CSINode): OK
401: Unauthorized
### `list` 列出或观测类别为 CSINode 的对象
#### HTTP 请求
GET /apis/storage.k8s.io/v1/csinodes
#### 参数
- **allowWatchBookmarks** (**查询参数**): boolean
}}">allowWatchBookmarks
- **continue** (**查询参数**): string
}}">continue
- **fieldSelector** (**查询参数**): string
}}">fieldSelector
- **labelSelector** (**查询参数**): string
}}">labelSelector
- **limit** (**查询参数**): integer
}}">limit
- **pretty** (**查询参数**): string
}}">pretty
- **resourceVersion** (**查询参数**): string
}}">resourceVersion
- **resourceVersionMatch** (**查询参数**): string
}}">resourceVersionMatch
- **sendInitialEvents** (**查询参数**): boolean
}}">sendInitialEvents
- **timeoutSeconds** (**查询参数**): integer
}}">timeoutSeconds
- **watch** (**查询参数**): boolean
}}">watch
#### 响应
200 (}}">CSINodeList): OK
401: Unauthorized
### `create` 创建 CSINode
#### HTTP 请求
POST /apis/storage.k8s.io/v1/csinodes
#### 参数
- **body**: }}">CSINode,必需
- **dryRun** (**查询参数**): string
}}">dryRun
- **fieldManager** (**查询参数**): string
}}">fieldManager
- **fieldValidation** (**查询参数**): string
}}">fieldValidation
- **pretty** (**查询参数**): string
}}">pretty
#### 响应
200 (}}">CSINode): OK
201 (}}">CSINode): Created
202 (}}">CSINode): Accepted
401: Unauthorized
### `update` 替换指定的 CSINode
#### HTTP 请求
PUT /apis/storage.k8s.io/v1/csinodes/{name}
#### 参数
- **name** (**路径参数**): string,必需
CSINode 的名称
- **body**: }}">CSINode,必需
- **dryRun** (**查询参数**): string
}}">dryRun
- **fieldManager** (**查询参数**): string
}}">fieldManager
- **fieldValidation** (**查询参数**): string
}}">fieldValidation
- **pretty** (**查询参数**): string
}}">pretty
#### 响应
200 (}}">CSINode): OK
201 (}}">CSINode): Created
401: Unauthorized
### `patch` 部分更新指定的 CSINode
#### HTTP 请求
PATCH /apis/storage.k8s.io/v1/csinodes/{name}
#### 参数
- **name** (**路径参数**): string,必需
CSINode 的名称
- **body**: }}">Patch,必需
- **dryRun** (**查询参数**): string
}}">dryRun
- **fieldManager** (**查询参数**): string
}}">fieldManager
- **fieldValidation** (**查询参数**): string
}}">fieldValidation
- **force** (**查询参数**): boolean
}}">force
- **pretty** (**查询参数**): string
}}">pretty
#### 响应
200 (}}">CSINode): OK
201 (}}">CSINode): Created
401: Unauthorized
### `delete` 删除 CSINode
#### HTTP 请求
DELETE /apis/storage.k8s.io/v1/csinodes/{name}
#### 参数
- **name** (**路径参数**): string,必需
CSINode 的名称
- **body**: }}">DeleteOptions
- **dryRun** (**查询参数**): string
}}">dryRun
- **gracePeriodSeconds** (**查询参数**): integer
}}">gracePeriodSeconds
- **pretty** (**查询参数**): string
}}">pretty
- **propagationPolicy** (**查询参数**): string
}}">propagationPolicy
#### 响应
200 (}}">CSINode): OK
202 (}}">CSINode): Accepted
401: Unauthorized
### `deletecollection` 删除 CSINode 的集合
#### HTTP 请求
DELETE /apis/storage.k8s.io/v1/csinodes
#### 参数
- **body**: }}">DeleteOptions
- **continue** (**查询参数**): string
}}">continue
- **dryRun** (**查询参数**): string
}}">dryRun
- **fieldSelector** (**查询参数**): string
}}">fieldSelector
- **gracePeriodSeconds** (**查询参数**): integer
}}">gracePeriodSeconds
- **labelSelector** (**查询参数**): string
}}">labelSelector
- **limit** (**查询参数**): integer
}}">limit
- **pretty** (**查询参数**): string
}}">pretty
- **propagationPolicy** (**查询参数**): string
}}">propagationPolicy
- **resourceVersion** (**查询参数**): string
}}">resourceVersion
- **resourceVersionMatch** (**查询参数**): string
}}">resourceVersionMatch
- **sendInitialEvents** (**查询参数**): boolean
}}">sendInitialEvents
- **timeoutSeconds** (**查询参数**): integer
}}">timeoutSeconds
#### 响应
200 (}}">Status): OK
401: Unauthorized