架构

DirectPV 按照 CSI 规范 实现。它附带以下作为 Kubernetes 中 Pod 运行的组件。

  • 控制器
  • 节点服务器

当 DirectPV 包含来自 DirectCSI 的传统卷时,以下附加组件也会作为 Pod 运行。

  • 传统控制器
  • 传统节点服务器

控制器

Diagram showing the flow of events from a Persistent Volume Claim through the CSI Provisioner or CSI Resizer to the Controller Server and finally to changes in either the DirectPVDrive CRD or the DirectPVVolume CRD

控制器作为名为 controllerDeployment Pod 运行。DirectPV 控制器有三个副本。副本会选举一个实例来处理请求。

每个 Pod 都有以下容器。

  • 控制器

    满足 CSI 创建、删除和扩展卷的请求。

  • CSI 供应器

    将来自 Persistent Volume Claim 的卷创建和删除请求桥接到 CSI 控制器。

  • CSI 调整大小器

    将来自 Persistent Volume Claim 的卷扩展请求桥接到 CSI 控制器。

控制器服务器

控制器服务器作为 controller Deployment Pod 中名为 controller 的容器运行。

它处理以下请求。

  • 创建卷

    控制器服务器在合适 DirectPVDrive CRD 上反转请求的存储空间后,创建一个新的 DirectPVVolume CRD。有关更多信息,请参阅 卷调度指南

  • 删除卷

    控制器服务器在释放 DirectPVDrive CRD 中先前保留的空间后,删除了未绑定卷的现有 DirectPVVolume CRD。

  • 扩展卷

    控制器服务器在 DirectPVDrive CRD 中反转请求的存储空间后,扩展了现有 DirectPVVolume CRD。

传统控制器

Diagram showing the flow of events from a persistent volume claim using the legacy style direct-csi-min-io storage class through the CSI provisioner or CSI REsizer to the Controller Server and finally either the DirectPVDrive CRD or the DirectPVVolume CRD

传统控制器作为名为 legacy-controllerDeployment Pod 运行。传统控制器有三个副本,位于任何 Kubernetes 节点。副本会选举一个实例来处理请求。

每个 Pod 都有以下容器。

  • CSI 供应器

    将来自 Persistent Volume Claim 的传统卷创建和删除请求桥接到 CSI 控制器。

  • 控制器

    仅满足 CSI 删除和扩展卷的请求。创建卷的请求被禁止。传统控制器仅适用于先前在 DirectCSI 中创建的传统卷。

  • CSI 调整大小器

    将来自 Persistent Volume Claim 的传统卷扩展请求桥接到 CSI 控制器。

传统控制器服务器

传统控制器服务器作为 legacy-controller Deployment Pod 中的 controller 容器运行。它处理以下请求。

  • 创建卷

    控制器服务器对此请求返回错误。DirectPV 不创建新的传统 DirectCSI 卷。

  • 删除卷

    控制器服务器在释放 DirectPVDrive CRD 中之前预留的空间后,会删除未绑定卷的 DirectPVVolume CRD。

  • 扩展卷

    控制器服务器在撤销 DirectPVDrive CRD 中请求的存储空间后,会扩展 DirectPVVolume CRD。

节点服务器

Diagram showing the flow of events from kubelet to the Node Server, the actions taken by event type, and updating the DirectPVDrive CRD or DirectPVVolume CRD

节点服务器以名为 node-serverDaemonSet Pod 形式运行在所有或选定的 Kubernetes 节点中。每个节点服务器 Pod 在节点上独立运行。

每个 Pod 都有以下容器。

  • 节点驱动程序注册器

    将节点服务器注册到 kubelet 以接收 CSI RPC 调用。

  • 节点服务器

    响应 stageunstagepublishunpublishexpand 卷 RPC 请求。

  • 节点控制器

    响应来自 DirectPVDriveDirectPVVolumeDirectPVNodeDirectPVInitRequest 的 CRD 事件。

  • 存活性探测

    公开 /healthz 端点,供 Kubernetes 检查节点服务器的存活性。

传统节点服务器

传统节点服务器以名为 legacy-node-serverDaemonSet Pod 形式运行在所有或选定的 Kubernetes 节点中。每个传统节点服务器 Pod 在节点上独立运行。

每个 Pod 包含以下正在运行的容器

  • 节点驱动程序注册器

    将传统节点服务器注册到 kubelet 以接收 CSI RPC 调用。

  • 节点服务器

    响应 stageunstagepublishunpublishexpand 卷 RPC 请求。

  • 存活性探测

    公开 /healthz 端点,供 Kubernetes 检查传统节点服务器的存活性。