NCP 4.1.2 or later

Edit the config map nsx-ncp-migrate-mp2p-user-spec in migrate-mp2p-job.yaml to specify the name of the Kubernetes cluster under the key "k8s-clusters". For example,
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 or earlier

After you have migrated the shared resources, you can migrate the Kubernetes cluster.

Edit user-spec.yaml

In user-spec.yaml, specify:
  • The top tier router ID and type of the cluster.
  • Any custom resources that need to be imported as a part of any resource importation. For example, you can specify the manager ID of a NAT rule that should be imported as a part of namespace resources. See Custom Resources for more details. You do not need to do anything here unless you have manually created some resources on the resources created by NCP. For example. you added a static route on an NCP-created tier-1 router.
  • Manager ID of the lb-service that is created by you as lb-service-mp-id to import the lb-service used by default in NCP if configured. This is the same resource as lb_service in the NCP spec (ncp.ini). If not used, you do not need to specify it.

Note that only the Kubernetes cluster specified in the config.yaml will be imported even if they are mentioned in the user-spec.yaml.

Steps to import a Kubernetes cluster

  1. Fill in the appropriate information in config.yaml and set import_shared_resources_only to False. See Sample config.yaml.
  2. Fill in the Kubernetes cluster information in user-spec.yaml. See Sample user-spec.yaml.
  3. Run the mp_to_policy_importer using either the config file or command line arguments. For example:
    python3 mp_to_policy_importer.py --config-file config.yaml

Note that only the Kubernetes cluster specified in the config.yaml will be imported even if they are mentioned in the user-spec.yaml.