- 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
-
Import harvester to rancher dashboard
-
Create cloud credential in rancher
-
Enable virtual network in harvester with
harvester-mgmt
-
Create the virtual network vlan1 with id 1
-
Create RKE1 template
-
Input the following content in user data
#cloud-config apt: http_proxy: http://192.168.0.254:3128 https_proxy: http://192.168.0.254:3128 write_files: - path: /etc/environment content: | HTTP_PROXY="http://192.168.0.254:3128" HTTPS_PROXY="http://192.168.0.254:3128" append: true
-
Expand Engine Options, add the following engine environment
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 a RKE1 cluster
-
Select harvester as cloud provider
-
Click Create button
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