An attempt to install and play with Rancher RKE2 air-gapped installation
What | How |
---|---|
IDK just do it | vagrant up |
skip provisioning and only bring up the VMs | VAGRANT_TRIGGER=false vagrant up |
use box of my choice | VM_BOX="some/name" vagrant up |
provision without the airgap | ANSIBLE_AIRGAP=false vagrant up |
disable airgap on existing VMs | ansible-playbook vagrant-site.yml -t airgap -e "airgap=off" |
enable airgap back on existing VMs | ansible-playbook vagrant-site.yml -t airgap -e "airgap=on" |
- vagrant
- virtualbox
- ansible
Vagrant will perform the following:
- provision VMs as defined in vagrant.yaml
- execute ansible on your machine:
- pre-onfigure vagrant VMs
- prepare RKE2 airgap install with rke2 linux images
- generate
my-cluster
inventory for rke2-ansible
- execute ansible on air-gapped controller machine:
- install rke2 on all air-gapped cluster VMs
-
An alias to
kubectl
is created on a master serveralias kubectl='sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml'
-
Port 6443 is forwarded by default from master-01 to localhost
-
RKE2's
/etc/rancher/rke2/rke2.yaml
kubeconfig file is saved to/tmp/rke2-ansible.yaml
Using this file is sufficient to connect from localhost with your favourite k8s tool.
- Support more linux os
- Add docker registry
- Support private repository install method
- intel OSX ventura (my host OS) - should easily run on your Linux laptop (or maybe even on Windows)
- vagrant 2.3.4
- virtualbox 7.04
- ansible 2.14.1
- ✅ Centos 7
- ✅ Centos 8
- ✅ Centos Stream 8
- ✅ Rocky Linux 8
- ✅ RHEL 7
- ✅ RHEL 8
- ❔ Ubuntu - not yet
-
Vagrant trigger is set to execute after the last machine defined in Vagantfile
Should you choose to provision VMs selectively the trigger for vagrant.sh is not going to execute. -
Since there's a config.yaml bug in rancherfederal/rke2-ansible at present the git repo being pulled is using my rke2-ansible fork
-
Virtualbox on OSX by default might not allow you to create required interfaces.
Try creating the following file/etc/vbox/networks.conf
* 10.0.0.0/8 192.168.0.0/16
-
There might be funky things going on if you use M1/M2 Apples
-
Completion time: ~22mins (on my laptop 😉)
./vagrant-test.sh
- Destroy all current VMs
- Run and save log to ./testing for all supported Linux distros
- Completion time for 6 tested distros so far ~2h