第 6 章 更新 OpenShift Data Foundation 外部机密
在升级到最新版本的 OpenShift Data Foundation 后,更新 OpenShift Data Foundation 外部机密。
批处理更新不需要更新外部 secret。例如,当从 OpenShift Data Foundation 4.19.x 更新至 4.19.y 时。
先决条件
- 将 OpenShift Container Platform 集群更新至 4.19.z 的最新稳定版本,请参阅更新集群。
确保 OpenShift Data Foundation 集群正常运行,数据具有弹性。进入到 Storage
Data Foundation Storage Systems 选项卡,然后点存储系统名称。 - 在 Overview - Block and File 选项卡中,检查 Status 卡并确认 存储集群 有一个绿色勾号指示其健康。
- 单击 Object 选项卡,并确认 Object Service 和数据弹性具有绿色勾号,指示其运行正常。RADOS 对象网关仅列出在以外部模式部署 OpenShift Data Foundation 时包含 RADOS 对象网关端点详细信息的情况。
- Red Hat Ceph Storage 必须安装并配置 Ceph 控制面板。
流程
使用以下方法之一下载 OpenShift Data Foundation 的
ceph-external-cluster-details-exporter.pypython 脚本。重要从 OpenShift Data Foundation 4.19 及之后的版本不再支持使用 CSV 下载
ceph-external-cluster-details-exporter.pypython 脚本。使用 ConfigMap 是唯一受支持的方法。CSV
oc get csv $(oc get csv -n openshift-storage | grep rook-ceph-operator | awk '{print $1}') -n openshift-storage -o jsonpath='{.metadata.annotations.externalClusterScript}' | base64 --decode >ceph-external-cluster-details-exporter.py# oc get csv $(oc get csv -n openshift-storage | grep rook-ceph-operator | awk '{print $1}') -n openshift-storage -o jsonpath='{.metadata.annotations.externalClusterScript}' | base64 --decode >ceph-external-cluster-details-exporter.pyCopy to Clipboard Copied! Toggle word wrap Toggle overflow ConfigMap
oc get cm rook-ceph-external-cluster-script-config -n openshift-storage -o jsonpath='{.data.script}' | base64 --decode > ceph-external-cluster-details-exporter.py# oc get cm rook-ceph-external-cluster-script-config -n openshift-storage -o jsonpath='{.data.script}' | base64 --decode > ceph-external-cluster-details-exporter.pyCopy to Clipboard Copied! Toggle word wrap Toggle overflow 通过在外部 Red Hat Ceph Storage 集群中的任何客户端节点上运行
ceph-external-cluster-details-exporter.py,更新外部 Red Hat Ceph Storage 存储集群的权限上限。您可能需要要求您的 Red Hat Ceph Storage 管理员来执行此操作。python3 ceph-external-cluster-details-exporter.py --upgrade
# python3 ceph-external-cluster-details-exporter.py --upgradeCopy to Clipboard Copied! Toggle word wrap Toggle overflow 用户的更新权限被设置为:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 根据您部署期间使用方法之一,运行之前下载的 python 脚本,可以是配置文件或命令行标志。
配置文件
创建一个
config.ini文件,其中包含初始部署期间使用的所有参数。运行以下命令来获取包含这些参数的 configmap 输出:oc get configmap -namespace openshift-storage external-cluster-user-command --output jsonpath='{.data.args}'$ oc get configmap -namespace openshift-storage external-cluster-user-command --output jsonpath='{.data.args}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将前面输出中的参数添加到
config.ini文件中。您可以将额外的参数添加到config.ini文件中,以在部署过程中使用的参数。有关参数的描述,请参阅 表 6.1 “升级过程中使用的强制和可选参数”。config.ini文件示例:[Configurations] format = bash cephfs-filesystem-name = <filesystem-name> rbd-data-pool-name = <pool_name> ...
[Configurations] format = bash cephfs-filesystem-name = <filesystem-name> rbd-data-pool-name = <pool_name> ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow 运行 python 脚本:
python3 ceph-external-cluster-details-exporter.py --config-file <config-file>
# python3 ceph-external-cluster-details-exporter.py --config-file <config-file>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将
<config-file> 替换为config.ini文件的路径。命令行标记
运行之前下载的 python 脚本,并为您的部署传递参数。确保使用您在原始部署中使用的所有标志,包括您已使用的任何可选参数。您还可以为部署期间使用的其他标志添加其他标记。有关参数的描述,请参阅 表 6.1 “升级过程中使用的强制和可选参数”。
python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name _<rbd block pool name>_ --monitoring-endpoint _<ceph mgr prometheus exporter endpoint>_ --monitoring-endpoint-port _<ceph mgr prometheus exporter port>_ --rgw-endpoint _<rgw endpoint>_ --run-as-user _<ocs_client_name>_ [optional arguments]
# python3 ceph-external-cluster-details-exporter.py --rbd-data-pool-name _<rbd block pool name>_ --monitoring-endpoint _<ceph mgr prometheus exporter endpoint>_ --monitoring-endpoint-port _<ceph mgr prometheus exporter port>_ --rgw-endpoint _<rgw endpoint>_ --run-as-user _<ocs_client_name>_ [optional arguments]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Expand 表 6.1. 升级过程中使用的强制和可选参数 参数 描述 rbd-data-pool-name
(必需)用于在 OpenShift Data Foundation 中提供块存储。
rgw-endpoint
(可选)如果要通过 Ceph RADOS 网关为 OpenShift Data Foundation 置备对象存储,请提供此参数。提供以下格式的端点:
<ip_address>:<port>。monitoring-endpoint
(可选) 接受由 OpenShift Container Platform 集群访问的活跃和待机 mgrs 的 IP 地址的逗号分隔列表。如果没有提供,则会自动填充该值。
monitoring-endpoint-port
(可选)与 ceph-mgr Prometheus exporter 关联的端口,由-
-monitoring-endpoint指定。如果没有提供,则会自动填充该值。run-as-user
(必需)在 OpenShift Data Foundation 集群部署期间使用的客户端名称。如果未设置其他客户端名称,请使用默认的客户端名称
client.healthchecker。rgw-pool-prefix
(可选) RGW 池的前缀。如果未指定,默认的前缀为
default。rgw-tls-cert-path
(可选)RADOS 网关端点 TLS 证书的文件路径。
rgw-skip-tls
(可选)此参数在提供自签名证书时会忽略 TLS 证书验证(不推荐)。
ceph-conf
(可选)Ceph 配置文件的名称。
k8s-cluster-name
(可选)Kubernetes 集群名称。
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
(可选)此参数会打印已执行命令的输出而不实际运行它们。
保存在上一步中运行脚本后生成的 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.xxxx", "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.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.xxxx", "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.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 文件。
- 登录 OpenShift Web 控制台。
-
点 Workloads
Secrets。 -
将项目设置为
openshift-storage。 - 点 rook-ceph-external-cluster-details。
-
点 Actions (⋮)
Edit Secret。 - 点 Browse,再上传该 JSON 文件。
- 点 Save。
验证步骤
要验证 OpenShift Data Foundation 集群是否健康,且数据具有弹性,请导航到 Storage
Data foundation Storage Systems 选项卡,然后点击存储系统名称。 -
在 Overview
Block and File 标签页中,检查 Details 卡来验证 RHCS 仪表板链接是否可用,并检查 Status 卡以确认存储集群有一个绿色勾号指示它处于健康状态。 - 单击 Object 选项卡,并确认 Object Service 和数据弹性具有绿色勾号,指示其运行正常。RADOS 对象网关仅列出在以外部模式部署 OpenShift Data Foundation 时包含 RADOS 对象网关端点详细信息的情况。
-
在 Overview
- 如果验证步骤失败,请联系红帽支持。