Developer Mode

Developer - 图1attention

Developer mode is intended to be used for development and testing purposes. Usage of this mode in production environments is not supported.

Prerequisites

  • The node has passed the host-check
  • Helm 3 and Git are installed on your local machine.

Installation of the First Node

You can install Harvester on an RKE2 cluster using the Helm CLI. For more information about installing and configuring the Harvester Helm chart, see the readme.

  1. Create an RKE2 configuration file.

    1. sudo mkdir -p /etc/rancher/rke2
    2. cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
    3. disable:
    4. - rke2-snapshot-controller
    5. - rke2-snapshot-controller-crd
    6. - rke2-snapshot-validation-webhook
    7. node-label:
    8. - harvesterhci.io/managed=true
    9. token: token
    10. cni:
    11. - multus
    12. - canal
    13. EOF
  2. Install RKE2.

    1. curl -sfL https://get.rke2.io | sudo sh -
    2. sudo systemctl enable rke2-server.service --now
  3. Create a kubeconfig file.

    1. mkdir -p ~/.kube
    2. sudo cp /etc/rancher/rke2/rke2.yaml ~/.kube/config
    3. sudo chown $(id -u):$(id -g) ~/.kube/config

    Developer - 图2important

    Allow some time for all pods in the kube-system namespace to reach the Ready state before proceeding to the next step.

    If you are unable to locate the kubectl binary in /usr/local/bin, check /var/lib/rancher/rke2/bin.

  4. Install system-upgrade-controller. This Kubernetes-native upgrade controller for nodes installs upgrade.cattle.io/v1 CRDs.

    1. kubectl apply -f https://github.com/rancher/system-upgrade-controller/releases/download/v0.13.1/system-upgrade-controller.yaml
  5. Create the cattle-system namespace.

    1. kubectl create ns cattle-system
  6. Add the Rancher chart repository.

    1. helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
  7. Install the Rancher v2.7.5 chart.

    1. helm install rancher rancher-latest/rancher \
    2. --namespace cattle-system \
    3. --set tls=external \
    4. --set rancherImagePullPolicy=IfNotPresent \
    5. --set rancherImage=rancher/rancher \
    6. --set rancherImageTag=v2.7.5 \
    7. --set noDefaultAdmin=false \
    8. --set features="multi-cluster-management=false\,multi-cluster-management-agent=false" \
    9. --set useBundledSystemChart=true \
    10. --set bootstrapPassword=admin

    Developer - 图3important

    Allow some time for all pods in the cattle-system namespace to reach the Ready state before proceeding to the next step.

  8. Clone the rancher/charts repository.

    1. git clone https://github.com/rancher/charts -b dev-v2.7
  9. Install the rancher-monitoring-crd chart.

    1. helm install rancher-monitoring-crd ./charts/charts/rancher-monitoring-crd/102.0.2+up40.1.2/
  10. Create the harvester-system namespace.

    1. kubectl create ns harvester-system
  11. Clone the harvester/harvester repository.

    1. git clone https://github.com/harvester/harvester.git
  12. Install the harvester-crd chart.

    1. helm install harvester-crd ./harvester/deploy/charts/harvester-crd --namespace harvester-system
  13. Install the Harvester chart using kube-vip running on a static IP.

    1. VIP_ADDRESS="replace with an IP which is allocated to any device, such as 192.168.5.131"
    2. helm install harvester ./harvester/deploy/charts/harvester --namespace harvester-system \
    3. --set harvester-node-disk-manager.enabled=true \
    4. --set "harvester-node-disk-manager.labelFilter={COS_*,HARV_*}" \
    5. --set harvester-network-controller.enabled=true \
    6. --set harvester-network-controller.vipEnabled=true \
    7. --set harvester-load-balancer.enabled=true \
    8. --set kube-vip.enabled=true \
    9. --set kube-vip-cloud-provider.enabled=true \
    10. --set longhorn.enabled=true \
    11. --set longhorn.defaultSettings.defaultDataPath=/var/lib/harvester/defaultdisk \
    12. --set longhorn.defaultSettings.taintToleration=kubevirt.io/drain:NoSchedule \
    13. --set rancherEmbedded=true \
    14. --set service.vip.enabled=true \
    15. --set service.vip.mode=static \
    16. --set service.vip.ip=${VIP_ADDRESS}
  14. Access the Harvester UI at https://${VIP\_ADDRESS}. The default password is admin.

Installation of Other Nodes

  1. Create an RKE2 configuration file.

    1. sudo mkdir -p /etc/rancher/rke2
    2. cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
    3. server: https://<vip address>:9345
    4. token: token
    5. EOF
  2. Install the RKE2 agent.

    1. curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE="agent" sudo sh -
    2. sudo systemctl enable rke2-agent.service --now

Uninstallation

  1. sudo /usr/local/bin/rke2-uninstall.sh