55-Import Harvester to Rancher in airgapped different subnet

Environment Setup

Note: Harvester and Rancher are under different subnet, can access to each other

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
  5. Enable vlan on harvester-mgmt
  6. Create virtual machine with name vlan1 and id: 1
  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>

image

  1. Create ubuntu cloud image from URL
  2. Create virtual machine and assign vlan network, confirm can get ip address

Setup squid HTTP proxy server

  1. When you enabled offline in vagrant example, you don’t need to install squid http proxy

Setup the airgapped rancher

  1. Create another airgapped network have different IP CIDR with ipxe example
  2. Make harvester private network can route to rancher private network (e.g set route)
  3. Create an ubuntu virtual machine on localhost machine
  4. Assign harvester and vagrant-libvirt network to the virtual machine
  5. Run curl -fsSL https://get.docker.com | bash to install docker
  6. Pull latest rancher image docker pull rancher/rancher:2.6-head
  7. Query default route ip r
  8. Remove default route ip r delete {delte route}
  9. Run rancher container by command:
$ sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 \
      -e HTTP_PROXY="http://192.168.0.1:3128" \
      -e HTTPS_PROXY="http://192.168.0.1:3128" \
      -e NO_PROXY="localhost,127.0.0.1,0.0.0.0,10.0.0.0/8,cattle-system.svc,192.168.0.0/24,.svc,.cluster.local,example.com" \
      --privileged rancher/rancher:v2.6.2
  1. Login rancher and set access url

Test steps

  1. Follow steps in 01-Import existing Harvester clusters in Rancher to import harvester
  2. Follow steps in 22-Create RKE2 Kubernetes Cluster to provision RKE2 cluster

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