第 4 章 部署 OpenShift Data Foundation 外部存储集群
使用这个流程部署外部存储集群,以添加额外存储或扩展您当前的内部存储集群。
先决条件
- 以内部模式部署的 OpenShift Data Foundation 集群。
- 确保 OpenShift Container Platform 和 OpenShift Data Foundation 升级到 4.15 版本。
流程
-
在 OpenShift Web 控制台中,导航到 Storage
Data Foundation Storage Systems 选项卡 - 单击 Create StorageSystem。
在 Backing storage 页面中,默认选择 Connect a external storage platform。
-
从可用选项中选择
Red Hat Ceph Storage作为 Storage platform。 - 点击 Next。
-
从可用选项中选择
在 Security and Network 页面中,
- 可选: 要选择加密,请选中 Enable encryption 复选框。
- 在 Connection 部分中,单击 Download Script 链接,以下载用于提取 Ceph 集群详细信息的 python 脚本。
若要提取 Red Hat Ceph Storage (RHCS)集群详细信息,请使用
admin 密钥在 Red Hat Ceph Storage 节点上运行下载的 python 脚本。在 RHCS 节点上运行以下命令查看可用参数列表:
python3 ceph-external-cluster-details-exporter.py --help
# python3 ceph-external-cluster-details-exporter.py --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow 您也可以从 MON 容器(容器化部署)或 MON 节点(RPM 部署)运行脚本。
注意使用
yum install cephadm命令,然后运行cephadm命令,使用容器部署 RHCS 集群。您必须使用cephadm命令拉取 RHCS 容器镜像,而不是使用yum将 Ceph 软件包安装到节点上。如需更多信息,请参阅 RHCS 产品文档。要从 RHCS 集群检索外部集群详情,请运行以下命令:
python3 ceph-external-cluster-details-exporter.py \ --rbd-data-pool-name <rbd block pool name> [optional arguments]
# python3 ceph-external-cluster-details-exporter.py \ --rbd-data-pool-name <rbd block pool name> [optional arguments]Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name ceph-rbd --monitoring-endpoint xxx.xxx.xxx.xxx --monitoring-endpoint-port xxxx --rgw-endpoint xxx.xxx.xxx.xxx:xxxx --run-as-user client.ocs
# python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name ceph-rbd --monitoring-endpoint xxx.xxx.xxx.xxx --monitoring-endpoint-port xxxx --rgw-endpoint xxx.xxx.xxx.xxx:xxxx --run-as-user client.ocsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在本例中,
rbd-data-pool-name
用于在 OpenShift Data Foundation 中提供块存储的必填参数。
rgw-endpoint
(可选)只有在 OpenShift Data Foundation 的 Ceph Rados 网关置备了对象存储时,才需要此参数。使用以下格式提供端点:
<ip_address>:<port>注意完全限定域名 (FQDN) 也支持
<FQDN>:<PORT>格式。monitoring-endpoint
(可选)此参数接受从 OpenShift Container Platform 集群访问的活跃和待机
mgrs的 IP 地址的逗号分隔列表。如果没有提供,则会自动填充该值。monitoring-endpoint-port
(可选)它是与
--monitoring-endpoint指定的ceph-mgrPrometheus exporter 关联的端口。如果没有提供,则会自动填充该值。run-as-user
(可选)此参数用于为脚本创建的 Ceph 用户提供名称。如果没有指定此参数,则会创建一个默认的用户名
client.healthchecker。新用户的权限被设置为:- caps: [mgr] allow command config
- caps: [mon] allow r, allow command quorum_status, allow command version
-
caps: [osd] allow rwx pool=
RGW_POOL_PREFIX.rgw.meta, allow r pool=.rgw.root, allow rw pool=RGW_POOL_PREFIX.rgw.control, allow rx pool=RGW_POOL_PREFIX.rgw.log, allow x pool=RGW_POOL_PREFIX.rgw.buckets.index
附加标记:
rgw-pool-prefix
(可选) RGW 池的前缀。如果未指定,默认的前缀为
default。rgw-tls-cert-path
(可选)RADOS 网关端点 TLS 证书的文件路径。
rgw-skip-tls
(可选)此参数在提供自签名证书时会忽略 TLS 证书验证(不推荐)。
ceph-conf
(可选)Ceph 配置文件的名称。
cluster-name
(可选)Ceph 集群名称。
output
(可选)需要存储输出的文件。
cephfs-metadata-pool-name
(可选)CephFS 元数据池的名称。
cephfs-data-pool-name
(可选)CephFS 数据池的名称。
cephfs-filesystem-name
(可选)CephFS 文件的名称。
rbd-metadata-ec-pool-name
(可选)纠删代码 RBD 元数据池的名称。
dry-run
(可选)此参数会打印已执行命令的输出而不实际运行它们。
restricted-auth-permission
(可选)此参数将
cephCSIKeyringsauth 权限限制为特定的池和集群。需要与此一起设置的强制标记是rbd-data-pool-name和cluster-name。如果 CephFS 用户有限制,您也可以通过cephfs-filesystem-name标志,以便权限仅限于特定的 CephFS 文件系统。注意此参数必须只应用于新部署。要限制每个池和每个集群的
csi-users,您需要为这些csi-users创建新的csi-users和新的 secret。带有受限身份验证权限的示例:
python3 /etc/ceph/create-external-cluster-resources.py --cephfs-filesystem-name myfs --rbd-data-pool-name replicapool --cluster-name rookStorage --restricted-auth-permission true
# python3 /etc/ceph/create-external-cluster-resources.py --cephfs-filesystem-name myfs --rbd-data-pool-name replicapool --cluster-name rookStorage --restricted-auth-permission trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使用 python 脚本生成的 JSON 输出示例:
[{"name": "rook-ceph-mon-endpoints", "kind": "ConfigMap", "data": {"data": "xxx.xxx.xxx.xxx:xxxx", "maxMonId": "0", "mapping": "{}"}}, {"name": "rook-ceph-mon", "kind": "Secret", "data": {"admin-secret": "admin-secret", "fsid": "<fs-id>", "mon-secret": "mon-secret"}}, {"name": "rook-ceph-operator-creds", "kind": "Secret", "data": {"userID": "<user-id>", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-node", "kind": "Secret", "data": {"userID": "csi-rbd-node", "userKey": "<user-key>"}}, {"name": "ceph-rbd", "kind": "StorageClass", "data": {"pool": "<pool>"}}, {"name": "monitoring-endpoint", "kind": "CephCluster", "data": {"MonitoringEndpoint": "xxx.xxx.xxx.xxx", "MonitoringPort": "xxxx"}}, {"name": "rook-ceph-dashboard-link", "kind": "Secret", "data": {"userID": "ceph-dashboard-link", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-provisioner", "kind": "Secret", "data": {"userID": "csi-rbd-provisioner", "userKey": "<user-key>"}}, {"name": "rook-csi-cephfs-provisioner", "kind": "Secret", "data": {"adminID": "csi-cephfs-provisioner", "adminKey": "<admin-key>"}}, {"name": "rook-csi-cephfs-node", "kind": "Secret", "data": {"adminID": "csi-cephfs-node", "adminKey": "<admin-key>"}}, {"name": "cephfs", "kind": "StorageClass", "data": {"fsName": "cephfs", "pool": "cephfs_data"}}, {"name": "ceph-rgw", "kind": "StorageClass", "data": {"endpoint": "xxx.xxx.xxx.xxx:xxxx", "poolPrefix": "default"}}, {"name": "rgw-admin-ops-user", "kind": "Secret", "data": {"accessKey": "<access-key>", "secretKey": "<secret-key>"}}][{"name": "rook-ceph-mon-endpoints", "kind": "ConfigMap", "data": {"data": "xxx.xxx.xxx.xxx:xxxx", "maxMonId": "0", "mapping": "{}"}}, {"name": "rook-ceph-mon", "kind": "Secret", "data": {"admin-secret": "admin-secret", "fsid": "<fs-id>", "mon-secret": "mon-secret"}}, {"name": "rook-ceph-operator-creds", "kind": "Secret", "data": {"userID": "<user-id>", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-node", "kind": "Secret", "data": {"userID": "csi-rbd-node", "userKey": "<user-key>"}}, {"name": "ceph-rbd", "kind": "StorageClass", "data": {"pool": "<pool>"}}, {"name": "monitoring-endpoint", "kind": "CephCluster", "data": {"MonitoringEndpoint": "xxx.xxx.xxx.xxx", "MonitoringPort": "xxxx"}}, {"name": "rook-ceph-dashboard-link", "kind": "Secret", "data": {"userID": "ceph-dashboard-link", "userKey": "<user-key>"}}, {"name": "rook-csi-rbd-provisioner", "kind": "Secret", "data": {"userID": "csi-rbd-provisioner", "userKey": "<user-key>"}}, {"name": "rook-csi-cephfs-provisioner", "kind": "Secret", "data": {"adminID": "csi-cephfs-provisioner", "adminKey": "<admin-key>"}}, {"name": "rook-csi-cephfs-node", "kind": "Secret", "data": {"adminID": "csi-cephfs-node", "adminKey": "<admin-key>"}}, {"name": "cephfs", "kind": "StorageClass", "data": {"fsName": "cephfs", "pool": "cephfs_data"}}, {"name": "ceph-rgw", "kind": "StorageClass", "data": {"endpoint": "xxx.xxx.xxx.xxx:xxxx", "poolPrefix": "default"}}, {"name": "rgw-admin-ops-user", "kind": "Secret", "data": {"accessKey": "<access-key>", "secretKey": "<secret-key>"}}]Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将 JSON 输出保存到带有
.json扩展名的文件注意要使 OpenShift Data Foundation 无缝工作,请确保使用 JSON 文件上传的参数(RGW 端点、CephFS 详细信息和 RBD 池等)在创建存储集群后在 RHCS 外部集群上保持不变。
在多租户部署中的 RHCS 集群已连接到带有较低版本的 OpenShift Data Foundation 部署时,运行命令。
python3 ceph-external-cluster-details-exporter.py --upgrade
# python3 ceph-external-cluster-details-exporter.py --upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
单击 Browse 以选择并上传 JSON 文件。
JSON 文件的内容填充并在文本框中显示。
-
点 Next 按钮,在上传
.json文件后启用。
在 Review and create 页面中,检查配置详情。
若要修改任何配置设置,请单击 Back 以返回到上一配置页面。
- 单击 Create StorageSystem。
验证步骤
-
导航到 Storage
Data Foundation Storage Systems 选项卡,并验证您可以查看所有存储集群。 - 验证外部 OpenShift Data Foundation 的所有组件是否已成功安装。具体步骤请参阅 验证外部 OpenShift Data Foundation 存储部署。