You can add external Kubernetes clusters using the Cloud Assembly API as an alternative to the user interface.

API calls can be executed from a remote physical machine with connectivity to Cloud Assembly. Here is an example of an API call to add an external cluster.

{
"customProperties":
{
 
"dcId":
"cbd683f6-3993-4e6d-a53c-a020bb45c08c"
 
}, 
 
"credentials":
{ 
 
"type":
"Password",
 
"userEmail":
"kube-admin",
"privateKey":
"test"
 
},
"name":
"test-cluster",
 
"address":
"https://10.1.39.36:6443",
"caCertificate":
"...",
 
"clusterType":
"EXTERNAL"
}

Note that docId is the ID of the data collector for accessing the on-prem resource. You can fetch all data collectors from the IaaS API at /iaas/api/data-collectors. The caCertificate property is the issuing certificate signed on the cluster's api certificate in PEM format.

After registering the cluster, you can list the namespaces and download the kube config file for them.