Deploy guest cluster to specific node with Node selector label

  • Related issues: #2316 [BUG] Guest cluster nodes distributed across failure domain
  • Related issues: #2384 [backport v1.0.3] Guest cluster nodes distributed across failure domains

Category:

  • Rancher integration

Verification Steps

RKE2 Verification Steps

  1. Open Harvester Host page then edit host config
  2. Add the following key value in the labels page:
    • topology.kubernetes.io/zone: zone_bp
    • topology.kubernetes.io/region: region_bp image
  3. Open the RKE2 provisioning page
  4. Expand the show advanced
  5. Click add Node selector in Node scheduling
  6. Use default Required priority
  7. Click Add Rule
  8. Provide the following key/value pairs
    • topology.kubernetes.io/zone: zone_bp
    • topology.kubernetes.io/region: region_bp image
  9. Provide the following user data
    password: 123456
    chpasswd: { expire: False }
    ssh_pwauth: True
    
  10. Create the RKE2 guest cluster
  11. Go to Harvester Virtual Machine page
  12. Edit yaml of the RKE2 guest cluster image Check the node affinity label have written into the yaml image
  13. Check the guest cluster VM have no error message
  14. Check can provision RKE2 cluster without error image
  15. Provide mismatch or not exists node scheduling or pod scheduling selector key/value pair in step 13 or 18
  16. Provision another RKE2 cluster
  17. Check VM should have error icon with message and automatically suspend the RKE2 provisioning

RKE1 Verification Steps

  1. Follow the steps 1 ~ 7 of the RKE2 verification section
  2. Go to Rancher Cluster Management page, add the RKE1 node template
  3. Click add Node selector in Node scheduling
  4. Use default Required priority
  5. Click Add Rule
  6. Provide the following key/value pairs
    • topology.kubernetes.io/zone: zone_bp
    • topology.kubernetes.io/region: region_bp image
  7. Create the RKE1 guest cluster
  8. Go to Harvester Virtual Machine page
  9. Edit yaml of the RKE1 guest cluster
  10. Check the node label have written into the yaml
  11. Check the guest cluster VM have no error message
  12. Check can provision RKE1 cluster without error
  13. Provide mismatch or not exists node scheduling or pod scheduling selector key/value pair in step 6 and 10
  14. Provision another RKE1 cluster
  15. Check VM should have error icon with message and automatically suspend the RKE1 provisioning

Expected Results

  • Can deploy guest RKE1 cluster vm to specific Harvester node matching the node scheduling and pod scheduling selector
  • Can deploy guest RKE2 cluster vm to specific Harvester node matching the node scheduling and pod scheduling selector
  • Can’t deploy guest RKE1 cluster vm to specific Harvester node if any of the node scheduling and pod scheduling selector not found on the Harvester node
  • Can’t deploy guest RKE2 cluster vm to specific Harvester node if any of the node scheduling and pod scheduling selector not found on the Harvester node