Rancher
The Platform provides several points of integration at the virtual cluster level. With the help of the vCluster.Pro plugin for Rancher, we can create, delete and manage vClusters from the Rancher Dashboard. Also, you can import any existing vClusters created within the platform into Rancher at the click of a button.
Setup
Installing the Rancher Plugin
The plugin can be installed as below.
- In the Rancher Dashboard, click on the Hamburger menu and selectExtensions.
- Click on the kebab menu on the right and selectManage Repositories.
- Click on the button on the right. Give the repository a name and enter
https://charts.loft.sh/
as Index URL. Finally click on the Create button at the bottom. - Navigate back to theExtensionspage and click on Available tab. Click Install on the plugin named VCluster.Pro.
- Once the plugin is installed, you will be redirected automatically to the Installed tab.
- Finally, on the Cluster resource (
management.cattle.io/v1 group
) of the host cluster, add aloft.sh/loft-hostname
label with the Loft hostname without protocol prefix, e.g. my-loft.demo.dev
Using the Rancher Plugin
Installing the plugin lets us create and delete virtual clusters from the Rancher Dashboard. Additionally, you can also access the platform's dashboard directly from the UI.
Creating a virtual cluster
- In the Rancher Dashboard, click on the button.
- 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.
- Click the button which will take you to the Create VirtualClusterInstance page within the platform.
- Click the Rancher configuration tab.
- Slide the Add to Rancher slider to enabled.
- Click on the button once you have configured the same as per your preference.
- Navigate back to the Rancher Dashboard. The virtual cluster would be available and in Activestate.
Deleting a virtual cluster
- In the Rancher Dashboard, click on the Delete icon for the virtual cluster you want to delete.
- You will be redirected to the platform's VirtualClusterInstance Page for confirmation.
- 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.
If the project your virtual cluster resides in does not have Rancher integration enabled, you will not see the Add to Rancher option! Please follow this guide to enable the same.
- During Virtual Cluster Creation
- On Existing Virtual Cluster
- From the Projects Navigator in the left hand pane, switch to the desired Project.
- Click on Virtual Clusters and the button.
- In the popup, optionally select the virtual cluster template, then click the button.
- Click the Rancher configuration tab.
- Slide the Add to Rancher slider to enabled.
- Finish configuring anything else you'd like on your virtual cluster, then click the button.
- From the Projects Navigator in the left hand pane, switch to the desired Project.
- Find your desired virtual cluster in the virtual cluster list. Slide theAdd to Rancher slider to enabled.
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!