Import Virtual Cluster
This API can be used to import an existing vcluster from a connected cluster into the project.
Example Import Virtual Cluster
An example Import Virtual Cluster:
apiVersion: management.loft.sh/v1
kind: ProjectImportVirtualCluster
metadata:
creationTimestamp: null
sourceVirtualCluster:
cluster: my-connected-cluster
importName: my-name-in-project
name: my-virtual-cluster-name
namespace: my-virtual-cluster-namespace
Import Virtual Cluster Reference
sourceVirtualCluster
required object pro
SourceVirtualCluster is the virtual cluster to import into this project
sourceVirtualCluster
required object proname
required string pro
Name of the virtual cluster to import
name
required string pronamespace
required string pro
Namespace of the virtual cluster to import
namespace
required string procluster
required string pro
Cluster name of the cluster the virtual cluster is running on
cluster
required string proowner
required object pro
Owner of the virtual cluster to import
owner
required object proimportName
required string pro
ImportName is an optional name to use as the virtualclusterinstance name, if not provided
the vcluster name will be used
importName
required string proupgradeToPro
required boolean false pro
UpgradeToPro indicates whether we should upgrade to Pro on import
upgradeToPro
required boolean false proskipHelmDeploy
required boolean false pro
SkipHelmDeploy will skip management of the vClusters helm deployment
skipHelmDeploy
required boolean false proImport Virtual Cluster (Create)
Import a virtual cluster through this API.
- curl
Create a file object.yaml
with the following contents:
apiVersion: management.loft.sh/v1
kind: ProjectImportVirtualCluster
metadata:
creationTimestamp: null
sourceVirtualCluster:
cluster: my-connected-cluster
importName: my-name-in-project
name: my-virtual-cluster-name
namespace: my-virtual-cluster-namespace
Then run the following curl command:
# Exchange my-object in the url below with the name of the Import Virtual Cluster
curl -s -X POST --insecure \
"https://$LOFT_DOMAIN/kubernetes/management/apis/management.loft.sh/v1/projects/my-object/importvirtualcluster" \
--data-binary "$(cat object.yaml)" \
-H "Content-Type: application/yaml" \
-H "Authorization: Bearer $ACCESS_KEY"