將 Portworx 卷從HPCS遷移至 Key Protect

請將您用於 Portworx 儲存卷的「Hyper Protect Crypto Services」(HPCS)加密功能遷移至「IBM Key Protect」( Key Protect )。

開始之前

在將您的 Portworx 加密卷從 Hyper Protect Crypto Services 遷移至 Key Protect 之前,請先完成以下步驟。

  1. 存取您的 Red Hat OpenShift 叢集
  2. 請確認您已安裝 Key Protect CLI 外掛程式
  3. 如果您尚未擁有,請建立一個 Key Protect 實例,以便進行遷移。
  4. 請確保您已備妥用於遷移磁碟區的「Portworx HPCS 至 Key Protect 遷移指令碼」。 當您申請工具存取權限時,此工具會包含在 hpcs-2-kp-k8s.zip 檔案中。 請參閱 遷移概覽 的第 1 步以獲取更多資訊。

遷移 Portworx 加密磁碟區

請按照以下步驟,將您的 Portworx 加密卷從 Hyper Protect Crypto Services 遷移至 Key Protect。 這些步驟包括執行遷移腳本。

  1. 請將您的 IBM Cloud API 金鑰設定為環境變數。

    export IC_API_KEY="YOUR_API_KEY"
    
  2. 請使用所需的參數執行遷移腳本。 請將占位符值替換為您的具體設定資訊。

    ./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
    

    請參閱表格以了解所需的命令參數。

    遷移腳本標記
    旗標 說明
    --region IBM Cloud 地區(例如,us-south )。
    --resource-group IBM Cloud 資源群組。
    --hpcs-endpoint Hyper Protect Crypto Services 金鑰管理端點 URL。
    --hpcs-instance-id Hyper Protect Crypto Services 實例 ID。
    --hpcs-root-key-id Hyper Protect Crypto Services 根金鑰識別碼。
    --kp-endpoint Key Protect 端點 URL。
    --kp-instance-id Key Protect 實例 ID。
    --kp-root-key-id Key Protect 根金鑰識別碼。
    --cluster-name Portworx 叢集名稱(取自 pxctl status 的輸出結果)。
    --px-namespace Portworx 在您的叢集中執行的命名空間。
  3. 遷移腳本執行完畢後,請更新 portworx 命名空間中的 px-ibm Kubernetes 祕密,使其指向您所設定的 Key Protect 實例及根金鑰。 請更新以下欄位:

    • IBM_SERVICE_API_KEY
    • IBM_INSTANCE_ID
    • IBM_BASE_URL
    • IBM_CUSTOMER_ROOT_KEY
  4. 在每個叢集節點上重新啟動 Portworx。 請等待每個節點上的 Portworx 顯示為正常狀態後,再繼續進行下一步。

    在節點上重新啟動 Portworx

    kubectl label node px/service=restart
    
  5. 請確認加密磁碟區是否可存取,並確認新建立的磁碟區是否使用「Key Protect」作為金鑰管理服務 (KMS)。