Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

27.15.2. 架构

CSI 驱动程序通常由容器镜像提供。这些容器不了解其运行的 OpenShift Container Platform。要在 OpenShift Container Platform 中使用与 CSI 兼容的存储后端,集群管理员必须部署几个组件,作为 OpenShift Container Platform 和存储驱动程序间的桥接。

下图提供了在 OpenShift Container Platform 集群中以 pod 运行的组件的概述。

CSI 组件构架

对于不同的存储后端,可以运行多个 CSI 驱动程序。每个驱动程序需要其自身的外部控制器部署,以及带驱动程序和 CSI 注册器的 DaemonSet。

27.15.2.1. 外部 CSI Controller

外部 CSI 控制器是一个部署,它部署带有以下三个容器的一个或多个 pod:

  • 将 OpenShift Container Platform 的 attachdetach 调用转换为相应的 ControllerPublishControllerUnpublish 调用 CSI 驱动程序的外部 CSI attacher 容器
  • 将 OpenShift Container Platform 的 provisiondelete 调用转换为 CSI 驱动程序的 CreateVolumeDeleteVolume 调用的外部 CSI 置备程序容器
  • CSI 驱动程序容器

CSI attacher 和 CSI provisioner 容器使用 UNIX 域套接字与 CSI 驱动程序容器对话,确保没有 CSI 通信。从 pod 以外无法访问 CSI 驱动程序。

注意

attachdetachprovisiondelete 操作通常需要 CSI 驱动程序在存储后端使用凭证。在 infrastructure 节点上运行 CSI controller pod,因此即使在一个计算节点上发生严重的安全破坏时,凭据也不会暴露给用户进程。

注意

对于不支持第三方的 attach/detach 操作的 CSI 驱动程序,还必须运行外部附加器。外部附加器不会向 CSI 驱动程序发出任何 ControllerPublishControllerUnpublish 操作。然而,它仍必须运行方可实现所需的 OpenShift Container Platform attachment API。