54-Import Airgapped Harvester From the Online Rancher

Environment Setup

Setup the airgapped harvester

  1. Fetch ipxe vagrant example with new offline feature https://github.com/harvester/ipxe-examples/pull/32
  2. Edit the setting.xml file
  3. Set offline: true
  4. Use ipxe vagrant example to setup a 3 nodes cluster https://github.com/harvester/ipxe-examples/tree/main/vagrant-pxe-harvester
  5. Enable vlan on harvester-mgmt
  6. Now harvester dashboard page will out of work
  7. Open Settings, edit http-proxy with the following values
HTTP_PROXY=http://proxy-host:port
HTTPS_PROXY=http://proxy-host:port
NO_PROXY=localhost,127.0.0.1,0.0.0.0,10.0.0.0/8,192.168.0.0/16,cattle-system.svc,.svc,.cluster.local,<internal domain>
  1. Create ubuntu cloud image from URL
  2. Create virtual machine with name vlan1 and id: 1
  3. Create virtual machine and assign vlan network, confirm can get ip address

Setup squid HTTP proxy server

  1. Move to vagrant pxe harvester folder
  2. Execute vagrant ssh pxe_server
  3. Run apt-get install squid
  4. Edit /etc/squid/squid.conf and add line
http_access allow all
http_port 3128
  1. Run systemctl restart squid

Setup the online rancher

  1. Create an ubuntu virtual machine on localhost machine
  2. Assign virtual network with internet connection to ubuntu host VM
  3. Run curl -fsSL https://get.docker.com | bash to install docker
  4. Run rancher container by command:
$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher:v2.6-head
  1. Login rancher and set access url

Test steps

  1. Access Rancher dashboard
  2. Navigate to Virtualization Management page
  3. Import existing harvester
  4. copy the registration URL
  5. Access Harvester
  6. Input registration URL
  7. Create cloud credential
  8. Provision a RKE1 cluster to harvester
  9. Provision a RKE1 cluster to harvester

Expected Results

  1. Can import harvester from Rancher correctly
  2. Can access downstream harvester cluster from Rancher dashboard
  3. Can provision at least one node RKE2 cluster to harvester correctly with running status
  4. Can explore provisioned RKE2 cluster nodes
  5. RKE2 cluster VM created running correctly on harvester node