With Rancher's virtualization management capabilities, you can import and manage multiple Harvester clusters. It provides a solution that unifies virtualization and container management from a single pane of glass.
Importing Harvester cluster
- Please refer to the Harvester & Rancher Support Matrix to find a desired Rancher version. You can use one of the following guides to deploy and provision Rancher and a Kubernetes cluster with the provider of your choice:
- Once the Rancher server is up and running, log in and click the hamburger menu and choose the Virtualization Management tab. Select Import Existing to import the downstream Harvester cluster into the Rancher server.
- Specify the
Cluster Nameand click Create. You will then see the registration guide; please open the dashboard of the target Harvester cluster and follow the guide accordingly.
- Once the agent node is ready, you should be able to view and access the imported Harvester cluster from the Rancher server and manage your VMs accordingly.
- From the Harvester UI, you can click the hamburger menu to navigate back to the Rancher multi-cluster management page.
In Harvester, we have leveraged the existing Rancher RBAC authorization such that users can view and manage a set of resources based on their cluster and project role permissions.
Within Rancher, each person authenticates as a user, which is a login that grants a user access to Rancher. As mentioned in Authentication, users can either be local or external.
Once the user logs into Rancher, their authorization, also known as access rights, is determined by global permissions and cluster and project roles.
- Global Permissions:
- Define user authorization outside the scope of any particular cluster.
- Cluster and Project Roles:
- Define user authorization inside the specific cluster or project where users are assigned the role.
Both global permissions and cluster and project roles are implemented on top of Kubernetes RBAC. Therefore, enforcement of permissions and roles is performed by Kubernetes.
- A cluster owner has full control over the cluster and all resources inside it, e.g., hosts, VMs, volumes, images, networks, backups, and settings.
- A project user can be assigned to a specific project with permission to manage the resources inside the project.
The following example provides a good explanation of how the multi-tenant feature works:
- First, add new users via the Rancher
Users & Authenticationpage. Then click
Createto add two new separated users, such as
project-owneris a user with permission to manage a list of resources of a particular project, e.g., the default project.
project-readonlyis a user with read-only permission of a particular project, e.g., the default project.
- Click one of the imported Harvester clusters after navigating to the Harvester UI.
- Click the
- Select a project such as
defaultand click the
Edit Configmenu to assign the users to this project with appropriate permissions. For example, the
project-owneruser will be assigned the project owner role.
- Click the
- Continue to add the
project-readonlyuser to the same project with read-only permissions and click Save.
- Open an incognito browser and log in as
- After logging in as the
project-owneruser, click the Virtualization Management tab. There you should be able to view the cluster and project to which you have been assigned.
- Click the Images tab to view a list of images previously uploaded to the
harvester-publicnamespace. You can also upload your own image if needed.
- Create a VM with one of the images that you have uploaded.
- Log in with another user, e.g.,
project-readonly, and this user will only have the read permission of the assigned project.
harvester-public namespace is a predefined namespace accessible to all users assigned to this cluster.
Delete Imported Harvester Cluster
Users can delete the imported Harvester cluster from the Rancher UI via Virtualization Management > Harvester Clusters. Select the cluster you want to remove and click the Delete button to delete the imported Harvester cluster.
You will also need to reset the
cluster-registration-url setting on the associated Harvester cluster to clean up the Rancher cluster agent.
Please do not run the
kubectl delete -f ... command to delete the imported Harvester cluster as it will remove the entire
cattle-system namespace which is required of the Harvester cluster.