移轉 NCP - 為 Kubernetes 叢集建立 NSX 資源
NCP 4.1.2 或更新版本
編輯 migrate-mp2p-job.yaml 中的組態對應 nsx-ncp-migrate-mp2p-user-spec,以在索引鍵「k8s-clusters」下指定 Kubernetes 叢集的名稱。例如,
apiVersion: v1 kind: ConfigMap metadata: name: nsx-ncp-migrate-mp2p-user-spec namespace: nsx-system labels: tier: nsx-networking component: nsx-ncp-migrate-mp2p version: v1 data: user_spec.yaml: |- k8s-clusters: k8scluster: my-kubernetes-cluster: <------- Specify the cluster name here
NCP 4.1.1.x 或更早版本
移轉共用資源後,您可以移轉 Kubernetes 叢集。
編輯 user-spec.yaml
在 user-spec.yaml 中,指定:
- 頂層路由器識別碼和叢集的類型。
- 任何需要在匯入資源中匯入的自訂資源。例如,您可以指定應匯入作為命名空間資源一部分之 NAT 規則的管理程式識別碼。如需詳細資料,請參閱自訂資源。除非您已在 NCP 所建立的資源上手動建立部分資源,否則您不需要在此處執行任何動作。例如,您已在 NCP 建立的第 1 層路由器上新增靜態路由。
- 您建立作為 lb-service-mp-id 的 LB 服務管理程式識別碼,以在 NCP 中匯入依預設使用的 LB 服務 (如果已設定)。這是與 NCP 規格 (ncp.ini) 中 lb_service 相同的資源。如果未使用,則不需要指定它。
請注意,系統僅會匯入 config.yaml 中指定的 Kubernetes 叢集 (即使是在 user-spec.yaml 中已提到)。
匯入 Kubernetes 叢集的步驟
- 在 config.yaml 中填寫適當的資訊,並將 import_shared_resources_only 設為 False。請參閱範例 config.yaml。
- 在 user-spec.yaml 中填寫 Kubernetes 叢集資訊。請參閱範例 user-spec.yaml。
- 使用組態檔或命令列引數來執行 mp_to_policy_importer。例如:python3 mp_to_policy_importer.py --config-file config.yaml
請注意,系統僅會匯入 config.yaml 中指定的 Kubernetes 叢集 (即使是在 user-spec.yaml 中已提到)。