Rancher Integration and Guest Kubernetes Clusters
local graph
Chapter 8: Rancher Integration And Guest Kubernetes Clusters
Section titled “Chapter 8: Rancher Integration And Guest Kubernetes Clusters”Rancher changes how Harvester fits into an environment. Harvester on its own is already a capable HCI platform, but when you plug it into Rancher you gain a control plane over multiple Harvester clusters and over all the Kubernetes clusters that run on top of them. Virtual machines, RKE2 clusters, and traditional Kubernetes workloads become visible in one place, with a single authentication and RBAC model and a unified way to apply policies and automation.
In practical terms, the integration covers several distinct flows. First, you import one or more Harvester clusters into Rancher and enable virtualization management so that administrators can reach the Harvester UI inside Rancher and manage VMs without switching tools. Second, you use the Harvester node driver in Rancher to create RKE2 guest clusters whose nodes are VMs on Harvester. Third, you can move toward fully declarative cluster provisioning with Cluster API and the Harvester infrastructure provider, often operated through Rancher Turtles. Finally, you use Rancher’s multi cluster features, projects, RBAC, and GitOps to organize teams and tenants in a way that keeps responsibilities clear and isolation strong.
8.1: Importing Harvester Into Rancher And Enabling Virtualization Management
Section titled “8.1: Importing Harvester Into Rancher And Enabling Virtualization Management”Rancher treats Harvester as a first class integration rather than just another Kubernetes cluster. The key feature is called Virtualization Management. Once enabled, it lets you import one or more Harvester clusters, see them alongside other downstream clusters, and open the Harvester UI directly inside Rancher. Rancher’s authentication providers and RBAC model apply across the integrated system, so you do not have to replicate user administration or role design in both places.
On a running Rancher installation, the integration starts by installing the Harvester UI extension, sometimes called the SUSE Virtualization extension in newer documentation. On recent Rancher versions this extension is managed through the Extensions or Apps area in the Rancher UI. You add the Harvester extension catalog if it is not already present, then install the extension that matches your Harvester version according to the support matrix. Once installed and enabled, a Virtualization Management entry appears in Rancher’s main menu.
Importing a Harvester cluster then becomes a guided process. From Virtualization Management, you choose to import an existing cluster and provide the cluster’s kubeconfig, either by pasting it or by uploading a file. Rancher connects to Harvester as it would to any Kubernetes cluster, deploys a few management agents, and establishes a secure channel for ongoing operations. After the connection is established, the Harvester cluster shows up in the list of managed virtualization clusters. Clicking on it opens the embedded Harvester UI. From there you can create and manage VMs, networks, and storage while still staying logged into Rancher.
From an API perspective, this import is just another cluster registration. Rancher creates a Cluster custom resource to represent the Harvester cluster and deploys its cattle-cluster-agent and cattle-node-agent pods into it. If you inspect the management cluster, you see the imported Harvester instance represented in the same way as any other downstream cluster, but with the additional virtualization integration enabled by the UI extension.
In some environments you may want to create an import token and kubeconfig programmatically rather than copying it manually from the Harvester UI. Harvester exposes its own kubeconfig through a secret in the kube-system or similar namespace on the Harvester control plane, which you can retrieve and reuse for automation. Once you have that kubeconfig, you can treat it as an opaque credential for Rancher’s cluster import API.
A convenient way to store such a kubeconfig for later use inside Rancher is to create a Kubernetes secret in the Rancher management cluster that can be referenced by cluster registration resources, whether configured manually or through GitOps.
apiVersion: v1kind: Secretmetadata: name: harvester-prod-kubeconfig namespace: cattle-systemtype: Opaquedata: kubeconfig: | LS0tLS1CRUdJTiBLSUJFTkNvbmZpZy0tLS0tCkFQSS12ZXJzaW9uOiB2MQpjbHVzdGVyczotCi0gY2x1c3RlcjoKICAgIGNlcnRpZmljYXR1LWF1dGhvcml0eS1kYXRhOiB...The base64 content in kubeconfig is the encoded kubeconfig file from Harvester. Rancher can use this secret during cluster import workflows driven through its APIs or GitOps pipelines.
Once Harvester is imported, Rancher’s role based access control becomes a central advantage. Users authenticate to Rancher using whatever backends you have configured, such as Active Directory, LDAP, SAML, or OIDC. Rancher maps them into global roles, cluster roles, and project roles. Those roles then determine whether a user can see the Virtualization Management area, which Harvester clusters they can access, whether they can open the embedded Harvester UI, and what operations they can perform inside it.
For example, you might create a custom global role that grants access only to the Virtualization Management UI and read access to imported Harvester clusters, then assign that role to an auditing team. For platform operators, you would assign or customize roles that allow full lifecycle operations on VMs and guest clusters. The key point is that you rely on Rancher’s existing authentication and RBAC configuration instead of building a second identity and authorization stack for Harvester.
Importing multiple Harvester clusters scales the same way. Rancher’s Virtualization Management page lists all integrated Harvester environments, possibly across data centers or regions. Each entry opens the relevant embedded UI. SRE teams can move between them in a few clicks, and higher level reporting can take advantage of Fleet and Rancher’s API to see not just Kubernetes clusters but also virtualization estates.
Over time, you should treat the relationship between Rancher and Harvester as a tightly versioned integration. Both SUSE and community documentation emphasize that certain Harvester versions pair cleanly with specific Rancher and Harvester UI extension versions, and that upgrades must follow a defined order. In practice, that means consulting the support matrix before upgrading either side and scheduling regression tests for virtualization management after changes, especially if you depend on Harvester heavily.
8.2: Creating RKE2 Guest Clusters On Harvester Nodes
Section titled “8.2: Creating RKE2 Guest Clusters On Harvester Nodes”Once Rancher is aware of Harvester, you can treat it as a cloud provider that hosts RKE2 clusters. Rancher includes a built in Harvester node driver that automates VM lifecycle on Harvester to provision Kubernetes nodes. When you create an RKE2 cluster from Rancher, you pick Harvester as the infrastructure provider. Rancher then uses Harvester’s API to create and manage VMs, configure networks, and attach volumes for the new cluster.
The Harvester node driver is enabled by default starting with Rancher v2.6.3, but it can be toggled in the Cluster Management drivers section. The driver uses a Harvester cloud credential that encapsulates the target Harvester cluster’s endpoint and token. To set it up, you create a cloud credential in Rancher, choose Harvester as the provider, and paste in the URL and token of the Harvester cluster you imported earlier. Once the credential is tested successfully, Rancher is ready to create VMs on that Harvester environment.
Creating an RKE2 cluster then becomes an extension of the standard Rancher cluster provisioning flow. From Cluster Management, you click Create, choose RKE2, and select Harvester as the node infrastructure. Rancher asks for a cluster name and namespace, an image reference that points to a Harvester VirtualMachineImage containing a cloud image, a network representing the Harvester VLAN or untagged network where nodes will live, and an SSH user that matches the cloud image. The Harvester documentation stresses that the node driver requires a VLAN network and cloud images, because it relies on cloud init to inject SSH keys and the RKE2 configuration.
On the Harvester side, each RKE2 node appears as a VM with a matching name and labels that associate it with the RKE2 cluster. Rancher monitors these VMs through the standard Kubernetes join process. When a VM boots, it uses cloud init to install RKE2, retrieve its node configuration from Rancher, and join the cluster. Once enough control plane and worker nodes join, the RKE2 cluster becomes ready and appears in Rancher’s list of downstream clusters.
Cloud images and cloud init are central to this arrangement. A typical pattern is to use an Ubuntu cloud image that has cloud init installed, then supply user data that configures SSH keys, installs or enables the RKE2 agent, and registers the node to a specific RKE2 cluster. Rancher generates this configuration dynamically based on cluster options you select.
To understand the mechanics more clearly, it helps to look at a simplified cloud init configuration used on Harvester VMs that will join an RKE2 cluster.
#cloud-confighostname: rke2-node-01users: - name: rancher sudo: ALL=(ALL) NOPASSWD:ALL shell: /bin/bash ssh_authorized_keys:write_files: - path: /etc/rancher/rke2/config.yaml permissions: "0644" content: | server: https://rke2-server.example.internal:9345 token: "RKE2_CLUSTER_TOKEN" node-name: "rke2-node-01" cloud-provider-name: "harvester" tls-san: - "rke2-server.example.internal" - path: /etc/sysctl.d/99-rke2.conf permissions: "0644" content: | net.bridge.bridge-nf-call-iptables = 1 net.ipv4.ip_forward = 1runcmd: - curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="agent" sh - - systemctl enable rke2-agent - systemctl start rke2-agentRancher usually does not show this template directly, but it generates equivalent content when provisioning nodes. The cloud provider name is set to harvester so that the RKE2 cluster uses the Harvester cloud provider integration, which lets it provision LoadBalancer services and in cluster persistent volumes against Harvester.
Networking is one of the key design choices when building RKE2 clusters on Harvester. The Harvester node driver assumes that you will attach nodes to a VLAN network with proper L2 and L3 connectivity for Kubernetes. You supply the network name in the Rancher UI. The resulting VMs then get NICs attached to the corresponding Linux bridge on Harvester, which maps to the VLAN on the physical switch. RKE2’s pod and service CIDRs are handled inside the cluster overlay network as usual, but node IPs sit in your real data center VLAN.
Storage integration is another important concern. For RKE2 clusters running on Harvester, you can use the Harvester CSI driver to let guest workloads consume Longhorn backed volumes from the underlying Harvester cluster. The supported path is to install the Harvester cloud provider and CSI driver into the RKE2 cluster, either manually or by using Rancher’s charts. Once installed, RKE2 workloads see storage classes backed by Harvester and can dynamically provision volumes that map to Longhorn volumes on the Harvester hosts. Test guides and how to documents describe this flow in detail, including required chart values and annotations.
Because Rancher treats these RKE2 clusters like any other downstream cluster, all of its features apply. You can enable monitoring and logging, apply global and cluster level CIS profiles, register them with Fleet for GitOps, and put them into projects for team based access. What changes is the underlying infrastructure. Instead of cloud provider APIs like EC2 or vSphere, nodes are Harvester VMs, and the lifecycle of those VMs is also visible from the Virtualization Management interface.
This is a powerful pattern for environments that want strong isolation between teams or workloads. Rather than trying to carve strict multi tenancy inside a single Kubernetes cluster, you can give each tenant or platform unit its own RKE2 cluster running on Harvester and manage them centrally in Rancher. High level isolation and lifecycle concerns are handled at the cluster level, while Harvester provides the VM and storage substrate.
8.3: Cluster API And Harvester Infrastructure Provider For Declarative Clusters
Section titled “8.3: Cluster API And Harvester Infrastructure Provider For Declarative Clusters”Rancher’s node driver model is a comfortable bridge for many teams, but as you mature it becomes natural to move toward fully declarative cluster lifecycle with Cluster API. Cluster API is a Kubernetes subproject that defines standard APIs for cluster creation, updates, and deletion. Providers implement infrastructure specific logic so that a Cluster resource and related Machine resources can describe complete Kubernetes clusters that run on clouds such as AWS, vSphere, or, in this case, Harvester.
The Harvester infrastructure provider for Cluster API is usually referred to as CAPH or CAPHV. It implements the infrastructure side of the Cluster API contract by talking to Harvester’s API, creating and managing VMs, and wiring up cloud init appropriately. Early versions have been tested with Harvester v1.2 and control plane providers such as Kubeadm and RKE2. Development is active, with recent releases extending feature coverage and stability.
Operating CAPH directly is possible, but many users will approach it through Rancher Turtles, Rancher’s integration layer for Cluster API. Rancher Turtles uses the CAPI operator to install providers and exposes content as Rancher native resources. That means you can declare clusters as YAML, store them in Git, and have Rancher and CAPH coordinate provisioning on Harvester.
The Cluster API model for a Harvester backed cluster involves several CRDs. At a minimum, you define a Cluster resource, a HarvesterCluster infrastructure resource, a control plane provider resource such as KubeadmControlPlane or RKE2 specific equivalents, and one or more MachineDeployment objects that use HarvesterMachineTemplate infrastructure templates. Together, these describe where the cluster’s control plane and worker nodes live and how many nodes of each type should exist.
Here is a compact but representative example of a Cluster API configuration that targets Harvester using Kubeadm as the control plane provider.
apiVersion: cluster.x-k8s.io/v1beta1kind: Clustermetadata: name: cphr-lab namespace: clustersspec: clusterNetwork: pods: cidrBlocks: ["10.244.0.0/16"] services: cidrBlocks: ["10.96.0.0/12"] infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 kind: HarvesterCluster name: cphr-lab-hv controlPlaneRef: apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane name: cphr-lab-control-plane---apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1kind: HarvesterClustermetadata: name: cphr-lab-hv namespace: clustersspec: controlPlaneEndpoint: host: 10.60.0.50 port: 6443 network: name: vlan-200-net cloudConfigRef: name: harvester-cloud-config---apiVersion: controlplane.cluster.x-k8s.io/v1beta1kind: KubeadmControlPlanemetadata: name: cphr-lab-control-plane namespace: clustersspec: replicas: 3 version: v1.30.3 machineTemplate: infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 kind: HarvesterMachineTemplate name: cphr-lab-control-plane-template kubeadmConfigSpec: clusterConfiguration: networking: podSubnet: "10.244.0.0/16"---apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1kind: HarvesterMachineTemplatemetadata: name: cphr-lab-control-plane-template namespace: clustersspec: template: spec: vm: imageName: ubuntu-22-04-cloud cpu: cores: 4 memory: size: 8Gi disks: - size: 100Gi storageClassName: longhorn networkName: vlan-200-net---apiVersion: cluster.x-k8s.io/v1beta1kind: MachineDeploymentmetadata: name: cphr-lab-md-0 namespace: clustersspec: replicas: 3 clusterName: cphr-lab selector: matchLabels: cluster.x-k8s.io/deployment-name: cphr-lab-md-0 template: metadata: labels: cluster.x-k8s.io/deployment-name: cphr-lab-md-0 spec: clusterName: cphr-lab version: v1.30.3 bootstrap: configRef: apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate name: cphr-lab-md-0-bootstrap infrastructureRef: apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1 kind: HarvesterMachineTemplate name: cphr-lab-worker-templateThis configuration shows the main concepts. The HarvesterCluster tells CAPH how to reach the Harvester API and which network to use for nodes. HarvesterMachineTemplate describes VM shapes and images. Control plane and worker node counts are specified declaratively, and Cluster API reconciles these desired states into actual Harvester VMs.
Using CAPH through Rancher Turtles usually means that you do not apply these YAML manifests directly to the management cluster by hand. Instead, you define them in a Git repository and let Fleet or similar tools apply them. Rancher Turtles installs the CAPI core and infrastructure providers by creating CAPIProvider resources, then watches for Cluster and HarvesterCluster objects to act on. Documentation describes the installation as a sequence where you first deploy the CAPI operator, then define providers, then apply cluster definitions.
The benefits of this model are clear for large estates. You get versioned cluster definitions, standard upgrade strategies through Cluster API’s rollout mechanisms, and the ability to treat Harvester backed clusters in the same way as clusters on other infrastructures. A new tenant or environment is just another Cluster resource. A scaling operation is changing a replicas field in Git. Decommissioning is removing a definition and letting controllers tear down VMs cleanly.
There are practical considerations. CAPH is relatively young compared to providers for hyperscalers or vSphere. You must align its version with Harvester versions and with the CAPI minor version installed by Rancher Turtles. The project documentation and recent release notes highlight which combinations are tested. There is also ongoing work to add CAPH to the official Cluster API provider list, which will simplify discovery and compatibility tracking.
In many environments, the progression looks like this. Initially, teams create RKE2 clusters on Harvester using the node driver and UI. As they gain experience and want more repeatability, they start defining those clusters as templates and scripts. Eventually, they adopt CAPH and Rancher Turtles for fully declarative provisioning, making Harvester just one of several infrastructures managed through Cluster API. The advantage is that skills and tooling carry across environments. Cluster API abstractions remain consistent, while individual providers handle the specifics of clouds or HCI platforms.
8.4: Multi Cluster Operations, RBAC And Tenant Isolation In Rancher
Section titled “8.4: Multi Cluster Operations, RBAC And Tenant Isolation In Rancher”Bringing Harvester into Rancher is not only about provisioning. It is about ongoing multi cluster operations and about giving teams access that lines up with their responsibilities. Rancher’s strength is that it treats clusters, including Harvester driven clusters, as manageable units that can be grouped, delegated, and automated in ways that fit different tenancy models.
The first dimension is simple multi cluster management. Rancher’s Cluster Management view lists all downstream Kubernetes clusters regardless of where they run. Virtualization Management lists all imported Harvester clusters. Operators can open any of these entries, see health, node status, installed apps, and events, and perform lifecycle operations such as upgrades or node scaling. For Harvester, virtualization management also provides access to VMs and virtualization specific settings. This is already a significant improvement over separate tools for virtualization and Kubernetes.
On top of that, Rancher introduces projects and namespaces as a way to organize workloads and access control inside a cluster. A project in Rancher groups namespaces, RBAC bindings, quotas, and in some cases network policies. You can assign users and groups to projects with specific roles, allowing them to manage workloads in those namespaces without granting broader cluster rights. Rancher documentation explicitly calls out projects as a building block for multi tenancy, and community articles show how to apply project network isolation to enforce stronger separation.
This project model is most directly relevant for guest Kubernetes clusters running on Harvester. For instance, a platform team might operate a shared RKE2 cluster for several development teams. In that cluster, each team receives one or more Rancher projects. Their rights are limited to those projects and namespaces. Network policies can prevent cross project traffic where desired. From Harvester’s perspective, this all happens inside VMs. Harvester provides the node VMs and storage, while Rancher manages the shared multi tenant Kubernetes layer on top.
Another axis of isolation is cluster level multi tenancy. Instead of packing multiple tenants into a single shared cluster, some organizations allocate one cluster per tenant or per product line. Rancher and Harvester make this achievable by automating cluster creation on Harvester and exposing them centrally. In this model, each tenant might have its own RKE2 cluster with its own admin team. Rancher applies global authentication but delegates cluster level admin roles to those teams. This gives very strong isolation, since tenants do not share cluster control planes, etcd, or node OS images. Industry guidance on multi tenancy often treats this cluster per tenant approach as the most secure option, with tools like Rancher recommended for managing the resulting fleet.
RBAC is the mechanism that ties these tenancy patterns together. Rancher defines global roles, cluster roles, and project roles. Global roles control which top level features a user can access, such as Virtualization Management, Fleet, or cluster provisioning. Cluster roles control actions on a specific cluster, including node operations, namespace creation, and project membership. Project roles govern actions inside a project, such as managing deployments or config maps.
Because Harvester clusters appear in Rancher as managed virtualization clusters, you can restrict access to them in the same way as to Kubernetes clusters. For example, only members of an infrastructure operations group may have roles that allow them to open Harvester UIs and manage VMs. Application teams would receive project scoped roles on guest clusters but no rights on the Harvester layer.
Fleet, Rancher’s GitOps engine, adds an additional control surface. It groups clusters into cluster groups and applies Git based configurations to those groups. Fleet also has its own multi user model. Recent versions introduce GitRepoRestriction resources that let admins restrict which Fleet git repos a given namespace can target, which is useful for multi tenant GitOps setups. In combination with cluster groups, this ensures that teams can only deploy configuration to clusters they are supposed to manage.
You can represent such restrictions explicitly. For example, the following object constrains a project namespace to target only specific Fleet resources.
apiVersion: fleet.cattle.io/v1alpha1kind: GitRepoRestrictionmetadata: name: team1-restriction namespace: project1allowedTargetNamespaces: - project1-apps - project1-infraWith this in place, repositories defined in the project1 namespace can only target specified namespaces, which may map to particular clusters or groups of clusters depending on your Fleet design. This is one of the tools that keeps tenants from accidentally or intentionally deploying configurations across organizational boundaries.
For Harvester specifically, multi cluster operations also involve the lifecycle of virtualization stacks. You may have a lab Harvester cluster, a staging cluster, and one or more production clusters. All are imported into Rancher and visible under Virtualization Management. Operators can apply upgrades in a controlled order, verify behavior on lower environments, and then roll changes into production. The Virtualization Management documentation emphasizes that Harvester upgrades should be coordinated with Rancher upgrades and with the Harvester UI extension, which fits neatly into this staged out process.
Tenant isolation also has a network and identity dimension beyond RBAC. For RKE2 clusters on Harvester, you can give each cluster its own VLANs, ingress controllers, and, if desired, identity providers at the Kubernetes level. Rancher handles authentication and base role assignments, but you can still integrate per cluster OIDC providers or use vCluster like technologies inside Rancher to create virtual clusters for finer grained isolation when you really need to share a physical cluster.
The pattern that emerges is layered. Harvester hosts VMs and Longhorn storage with strong separation across clusters. Rancher manages those Harvester clusters and the RKE2 guest clusters they host. Projects, namespaces, Fleet, and RBAC shape access and deployment within and across clusters. Tenant isolation can be achieved through strict project isolation in shared clusters, through dedicated clusters per tenant on Harvester, or through combinations such as virtual clusters inside larger shared clusters. The right choice depends on regulatory requirements, risk profile, and operational capacity, but Rancher and Harvester give you the tools to implement any of those patterns cleanly.