rancherfederal/rke2-ansible

How can one leverage a CNI besides Canal?

TheFutonEng opened this issue · 5 comments

Howdy, I'm leveraging this great playbook to install RKE2 via the air-gapped method described in the README. I'd like to change the CNI to Calico from the default but it's not clear what knob needs to be turned in order to pull that off.

Hello.
I did this in my air-gapped environment with ansible templates.
I made a variable called "cni_chioce" and gave it either canal or calico
if its canal, you can proceed with this playbook as canal is the default option.
if It's calico, you need to configure in /etc/rancher/rke2/config.yaml

 cni:
    - calico
  disable:
    - rke2-canal
    - rke2-kube-proxy
    

you will also need to download the image of calico from here according to your version
https://github.com/rancher/rke2/releases
Hope it helps!

Thanks @DanielKuzmenkoo, I appreciate the message. I take it the Calico images need to be placed in the same location as the other images that the playbook put in place?

I also noticed that there are three different rke2_config blocks in various places in the playbook. I assume all of them need to be updated? Thinking the server and agent blocks at a minimum are necessary.

@DanielKuzmenkoo, how did you adjust /var/lib/rancher/rke2/server/manifests/rke2-calico.yaml? I believe this is the file that Rancher uses to install Calico.

Comparing an air-gapped installation to one that has access to the internet shows that this file doesn't exist after the air-gapped installation, suggesting that it is downloaded from somewhere. How did you switch your air gapped installation to use Calico?

Hello again.
I added a task that copies with the calico images that can be downloaded from the release page here
And I added Jinja template that will configure the rke2-config if I chose calico or canal and copy the relevant configuration.
I will post tomorrow the tasks that I have been working on, hope it will help

Thanks for the help @DanielKuzmenkoo !