71-Manually Deploy Harvester csi driver to RKE2 Cluster

  • Related task: #2755 Steps to manually install Harvester csi-driver on RKE2 cluster

Reference Document

Deploying with Harvester RKE2 Node Driver

Verify steps

  1. ssh to Harvester management node

  2. Extract the kubeconfig of Harvester with cat /etc/rancher/rke2/rke2.yaml

  3. Change the server value from https://127.0.0.1:6443/ to your VIP

  4. Copy the kubeconfig and add into your local ~/.kube/config file

  5. Import Harvester in Rancher

  6. Create cloud credential

  7. Provision a RKE2 cluster image

  8. Provide the login credential in user data

    password: 123456
    chpasswd: { expire: False }
    ssh_pwauth: True
    
  9. Select cloud-provider to Default - RKE2 Embedded (on Rancher 2.6 you need to select to NONE) image

  10. Check RKE2 cluster provisioning in Ready

  11. Use the new generate_cloud_provider_config.sh to generate cloud-config content for csi-driver

    ./generate_cloud_provider_config.sh <serviceaccount name> <namespace>
    
    e.g ./generate_cloud_provider_config.sh rke2 default
    
  12. ssh to the RKE2 guest cluster vm

  13. Create the config-files directory

    mkdir -p /var/lib/rancher/rke2/etc/config-files
    
  14. Add the cloud-provider-config file from the cloud-config part of output generated from script

    vim /var/lib/rancher/rke2/etc/config-files/cloud-provider-config
    
  15. Access RKE2 guest cluster on Rancher

  16. Switch to All Namespace

  17. Open Apps -> Charts

  18. Install Harvester CSI Driver from the Rancher marketplace. You do not need to change the cloud-config path. image image

  19. Check can successfully install csi-driver on Installed Apps image

  20. Check Harvester set to the default storage class image

  21. Create a nginx deployment in Workload -> Deployments

  22. Create a Persistent Volume Claims, select storage class to harvester

  23. Select the Single-Node Read/Write

  24. Create a standalone PVC on PersistentVolumeClaims page with harvester storage class

Expected Results

  1. Check can deploy nginx service correctly image

  2. Check can correctly create PVC in PersistenVolumeClaims image

  3. Check can correctly create PV in PersistentVolumes image

  4. Open Harvester Volumes page, check the corresponding volume exists image

  5. Check can correctly create PVC and PV image image

  6. Check can create corresponding volume on Harvester image