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
kind
required string
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
kind
required string apiVersion
required string
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
apiVersion
required string metadata
required object
metadata
required object sourceVirtualCluster
required object
SourceVirtualCluster is the virtual cluster to import into this project
sourceVirtualCluster
required object upgradeToPro
required boolean true
UpgradeToPro indicates whether we should upgrade to Pro on import
upgradeToPro
required boolean true Import 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"