This repo demos how to create cluster on top of harvester. In other words, you could use virtual machine to start the RKE2 cluster in the virtual machine of harvester on Rancher.
More detail about this, please see Harvester Node Driver and Virtualization on Kubernetes with Harvester.
- Have a harvester cluster
- Have a rancher cluster
- Import harvester cluster
- Create access and secret key in rancher GUI, and copy it to
terraform.tfvars
. (usecp terraform.tfvars.example terraform.tfvars
first) - Upload the cloud image in image tab of harvester cluster (
harvester-public
namespace) For example,focal-server-cloudimg-amd64.img
in https://cloud-images.ubuntu.com/focal/current/ - Create
vlan1
in VM Network tab of harvester cluster terraform init
andterraform apply
There are two different guest cluster you could try
- default:
terraform apply -target=module.guest_cluster
- harvester-cloud-provider:
terraform apply -target=module.guest_cluster_harvester_cloud_provider
This one should set up thekvm.config
fromkvm.config.template
first.
# harvester cloud credential
terraform import rancher2_cloud_credential.harvesterkvm "cattle-global-data:cc-xxxxx.harvester"
# guest cluster
terraform import module.guest_cluster.rancher2_cluster_v2.rancher_guest_cluster fleet-default/local-test