Add Existing Virtual Clusters
Any running virtual cluster can be added to the platform. When adding a virtual cluster to the platform, the virtual cluster must be added to a designated project and when the virtual
cluster is added to the platform, a VirtualClusterInstance
resource is created in the platform.
Connect to the Platform: In order to use any
vcluster platform
command, you need to be connected to the platform.When you started the platform, you would have automatically connected to the platform when you ran
vcluster platform start
.If you aren't sure if you are connected and already have a running platform, then you can login. Before running this command, be sure that your kubecontext is set to the cluster running the platform.
Login to the platform.vcluster login
Add Host Cluster to the Platform (Optional): If you want to add the host cluster to the platform, then run this command. Before running this command, be sure that your kubecontext is set to the host cluster.
Connect host cluster to platform.CLUSTER_ID=my-host-cluster
UI_CLUSTER_NAME="My Host Cluster"
vcluster platform add cluster $CLUSTER_ID --display-name $UI_CLUSTER_NAMEAdding Virtual Cluster to the Platform: Before running this command, be sure that your kubecontext is set to the host cluster running the vcluster that you want to add.
Add vcluster to the platform in a project.VIRTUAL_CLUSTER_ID=my-vcluster
PROJECT=default
VIRTUAL_CLUSTER_IMPORT_NAME="My vCluster"
vcluster platform add vcluster $VIRTUAL_CLUSTER_ID \
--project $PROJECT
--import-name $VIRTUAL_CLUSTER_IMPORT_NAME