將 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 CLI 外掛程式。
- 如果您尚未擁有,請建立一個 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 根金鑰識別碼。 --kp-endpointKey Protect 端點 URL。 --kp-instance-idKey Protect 實例 ID。 --kp-root-key-idKey Protect 根金鑰識別碼。 --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)。