1.4. 更新 Ceph 对象网关,以便在多站点部署中使用 cephadm 自签名证书
从 Red Hat Ceph Storage 8.1 开始,Red Hat Ceph Storage 引入了一个新的 root 证书颁发机构(CA)格式。因此,当在 Red Hat Ceph Storage 版本 8.0 或更早版本的多站点部署中更新 Ceph 对象网关时,您必须完成额外的步骤来启用 cephadm 自签名证书。
在以下情况下使用此流程:
- 您将从 Red Hat Ceph Storage 版本 8.0 或更早版本升级,并计划使用 cephadm 自签名证书。
- Cephadm 自签名证书已过期。
如果您不计划使用 cephadm 自签名证书,或者 root CA commonName 具有 cephadm-root-<FSID> 格式,且证书有效,则不需要这个过程。
先决条件
开始之前,请确保您的 Red Hat Ceph Storage 存储系统使用旧的风格的 root CA。
ceph orch certmgr cert ls
-
如果 root CA
commonName具有cephadm-root格式,则采用旧样式。继续执行此处记录的步骤。 -
如果 root CA
commonName具有cephadm-root-<FSID> 格式,您的集群已升级到新格式,且不需要进一步的操作。
流程
删除前面的 root CA。
语法
ceph orch certmgr rm cephadm_root_ca_cert重新加载
certmgr,以强制创建新的 root CA。语法
ceph orch certmgr reload验证
certmgr是否已正确加载。语法
ceph orch certmgr cert ls确保
cephadm_root_ca_cert主题具有以下格式:cephadm-root-<FSID>根 CA 已升级。
- 为使用 cephadm 自签名证书的所有服务重新发布新证书。
刷新任何现有 Grafana 服务。
删除所有 Grafana 证书。
必须为使用自签名证书的每个 Grafana 服务执行此步骤。
语法
ceph orch certmgr cert rm grafana_cert --hostname=HOSTNAME只有在所有证书都被删除后才会继续。
重新部署 Grafana。
语法
ceph orch redeploy grafana验证所有 Grafana 服务是否都正常运行。
语法
ceph orch ps --service-name grafana验证是否为 Grafana 创建了新的 cephadm 签名证书。
语法
ceph orch certmgr cert ls
刷新任何现有 Ceph 对象网关(RGW)服务。
必须为使用自签名证书的每个 Ceph 对象网关服务执行此步骤。
语法
ceph orch certmgr cert rm rgw_frontend_ssl_cert --service-name RGW-SERVICE-NAME ceph orch redeploy RGW-SERVICE-NAME验证 Ceph 对象网关(RGW)服务是否已部署并按预期运行。
语法
ceph orch ps --service-name RGW_SERVICE_NAME验证证书。
语法
ceph orch certmgr cert ls升级 Ceph 控制面板证书。
为仪表板生成 cephadm 签名证书。
在 cephadm 命令行界面(CLI)中运行以下命令:
语法
json="$(ceph orch certmgr generate-certificates dashboard)" printf '%s' "$json" | jq -r '.cert' > dashboard.crt printf '%s' "$json" | jq -r '.key' > dashboard.key设置新的生成的证书和密钥。
在 Ceph 命令行界面(CLI)中运行以下命令:
语法
ceph dashboard set-ssl-certificate -i dashboard.crt ceph dashboard set-ssl-certificate-key -i dashboard.key生成
dashboard.crt和dashboard.key对文件。
启用和禁用 Ceph 控制面板来加载新证书。
语法
ceph mgr module disable dashboard ceph mgr module enable dashboard