- Related task: #1052 Test Air gap with Rancher integration
Environment Setup
Setup the airgapped harvester
- Fetch ipxe vagrant example with new offline feature https://github.com/harvester/ipxe-examples/pull/32
- Edit the setting.xml file
- Set offline:
true
- Use ipxe vagrant example to setup a 3 nodes cluster
- Enable vlan on
harvester-mgmt
- Now harvester dashboard page will out of work
- Create virtual machine with name
vlan1
and id:1
- 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>
- Create ubuntu cloud image from URL
- Create virtual machine and assign vlan network, confirm can get ip address
Setup squid HTTP proxy server
- When you enabled
offline
in vagrant example, you don’t need to install squid http proxy
Setup the airgapped harvester
- Create an ubuntu virtual machine on localhost machine
- Assign
harvester
andvagrant-libvirt
network to the virtual machine - Run
curl -fsSL https://get.docker.com | bash
to install docker - Pull latest rancher image
docker pull rancher/rancher:2.6.3-rc6
- 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.254:3128" \
-e HTTPS_PROXY="http://192.168.0.254: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/16,.svc,.cluster.local,example.com" \
--privileged rancher/rancher:v2.6.3-rc6
- Login rancher and set access url
- Set the following in Advanced - user data in the create RKE2 cluster page
#cloud-config
apt:
http_proxy: http://192.168.0.254:3128
https_proxy: http://192.168.0.254:3128
- In Cluster Configuration - Agent Environment Vars, add the following
HTTP_PROXY: http://192.168.0.254:3128
HTTPS_PROXY: http://192.168.0.254:3128
NO_PROXY: localhost,127.0.0.1,0.0.0.0,10.0.0.0/8,cattle-system.svc,.svc,.cluster.local
- Create 4 core, 8GB RKE2 cluster in harvester
Test steps
- Follow steps in
01-Import existing Harvester clusters in Rancher
to import harvester - Follow steps in
22-Create RKE2 Kubernetes Cluster
to provision RKE2 cluster
Expected Results
- Can import harvester from Rancher correctly
- Can access downstream harvester cluster from Rancher dashboard
- Can provision at least one node RKE2 cluster to harvester correctly with running status
- Can explore provisioned RKE2 cluster nodes
- RKE2 cluster VM created running correctly on harvester node