Skip to main content

Using the Rancher Integration

After configuring the Rancher integration, you can now create and delete virtual clusters from the Rancher UI. Additionally, you can also access the vCluster Platform directly from the Rancher UI.

Creating a virtual cluster

  1. In the Rancher Dashboard, click on the button.

  2. Enter a name for the virtual cluster and select the Loft Project in which you wish to create the virtual cluster. Only those projects which have the Rancher Integration enabled would be displayed in the list.

  3. Click the button which will take you to the Create VirtualClusterInstance page within the platform.

  4. Click the Rancher configuration tab.

  5. Slide the Add to Rancher slider to enabled.

  6. Click on the button once you have configured the same as per your preference.

  7. Navigate back to the Rancher Dashboard. The virtual cluster would be available and in Activestate.

Deleting a virtual cluster

  1. In the Rancher Dashboard, click on the Delete icon for the virtual cluster you want to delete.

  2. You will be redirected to the platform's VirtualClusterInstance Page for confirmation.

  3. Click on the to confirm. The virtual cluster will be deleted from Rancher.

Importing vClusters into Rancher

Once a project has Rancher integration enabled, virtual clusters within that project are eligible to be synced into Rancher. You can enable virtual cluster import into Rancher during the virtual cluster creation step, or by enabling this feature on existing virtual clusters.

Make Sure Your Project Has Rancher Enabled!

If the project your virtual cluster resides in does not have Rancher integration enabled, you will not see the Add to Rancher option!

  1. From the Projects Navigator in the left hand pane, switch to the desired Project.

  2. Click on Virtual Clusters and the button.

  3. In the popup, optionally select the virtual cluster template, then click the button.

  4. Click the Rancher configuration tab.

  5. Slide the Add to Rancher slider to enabled.

  6. Finish configuring anything else you'd like on your virtual cluster, then click the button.

Disabling Rancher Integration

You may disable the Rancher integration at a per virtual cluster or per project level by toggling the same sliders used to enable it. Disabling the integration at the virtual cluster level simply removes it in Rancher. Disabling the integration at the project level removes all virtual clusters from Rancher, so be careful when disabled at this level!

Since virtual clusters are not using physical nodes, you may need to hide the nodes from Rancher in order for the virtual nodes to not be counted in your Rancher node count. In order to do so, you will need to enable a plugin as part of your virtual cluster deployment.

Add this to your vcluster.yaml configuration:

plugins:
rancher:
image: ghcr.io/loft-sh/rancher-nodeless-plugin:0.0.3

Using templates, you can make sure that all of your vCluster are using the plugin to avoid unnecessary billing by enforcing the use of the plugin.