将 Portworx 卷从HPCS迁移到 Key Protect
请将 Portworx 存储卷的 Hyper Protect Crypto Services (HPCS)加密迁移至 IBM Key Protect ( Key Protect )。
准备工作
在将您的 Portworx 加密卷从 Hyper Protect Crypto Services 迁移到 Key Protect 之前,请完成以下步骤。
- 访问您的 Red Hat OpenShift 集群。
- 请确保已安装 Key Protect 命令行插件。
- 如果您还没有,请创建一个 Key Protect 实例,用于此次迁移。
- 请确保您已获取用于迁移卷的 Portworx HPCS 至 Key Protect 迁移脚本。 当您申请工具访问权限时,该工具将包含在
hpcs-2-kp-k8s.zip文件中。 有关更多信息,请参阅 迁移概述 中的步骤 1。
迁移 Portworx 加密卷
请按照以下步骤,将您的 Portworx 加密卷从 Hyper Protect Crypto Services 迁移至 Key Protect。 这些步骤包括运行一个迁移脚本。
-
将您的 IBM Cloud API密钥设置为环境变量。
export IC_API_KEY="YOUR_API_KEY" -
使用所需的参数运行迁移脚本。 请将占位符替换为您具体的配置信息。
./hpcs_kp_px_migration_script.sh \ --region us-south \ --resource-group Default \ --hpcs-endpoint https://api.us-south.hs-crypto.cloud.ibm.com:8389/ \ --hpcs-instance-id <hpcs-instance-id> \ --hpcs-root-key-id <hpcs-root-key-id> \ --kp-endpoint https://us-south.kms.cloud.ibm.com/ \ --kp-instance-id <kp-instance-id> \ --kp-root-key-id <kp-root-key-id> \ --cluster-name my-px-cluster \ --etcd-endpoints <etcd-endpoints> \ --px-namespace kube-system请参阅下表了解所需的命令参数。
迁移脚本标志 标志 描述 --regionIBM Cloud 地区(例如, us-south)。--resource-groupIBM Cloud 资源组。 --hpcs-endpointHyper Protect Crypto Services 密钥管理端点 URL。 --hpcs-instance-idHyper Protect Crypto Services 实例 ID。 --hpcs-root-key-idHyper Protect Crypto Services 根密钥 ID。 --kp-endpointKey Protect 端点 URL。 --kp-instance-idKey Protect 实例 ID。 --kp-root-key-idKey Protect 根密钥 ID。 --cluster-namePortworx 集群名称(来自 pxctl status的输出)。--px-namespacePortworx 在您的集群上运行的命名空间。 -
迁移脚本完成后,请更新
portworx命名空间中的px-ibmKubernetes 密钥,使其指向您配置的 Key Protect 实例和根密钥。 请更新以下字段:IBM_SERVICE_API_KEYIBM_INSTANCE_IDIBM_BASE_URLIBM_CUSTOMER_ROOT_KEY
-
在每个集群节点上重启 Portworx。 请等待每个节点上的 Portworx 显示为“正常”状态,然后再继续进行下一步。
在某个节点上重启 Portworx。
kubectl label node px/service=restart -
请验证加密卷是否可访问,并确保新创建的卷使用 Key Protect 作为密钥管理服务(KMS)。