https://rancher.com/ logo
Title
c

crooked-cat-21365

02/13/2023, 6:42 AM
How can I tell Rancher which CNI to use for setting up a new K3S cluster? https://ranchermanager.docs.rancher.com/faq/container-network-interface-providers doesn't tell; it is all about RKE/RKE2.
a

agreeable-oil-87482

02/13/2023, 8:34 AM
If your CNI is not in the dropdown list you can modify the cluster yaml, specify:
cni:
  - none
And provide your own CNI manifest as an addon
c

crooked-cat-21365

02/13/2023, 9:04 AM
Does Kubernetes work with CNI: none? I thought some kind of CNI is mandatory.
a

agreeable-oil-87482

02/13/2023, 9:06 AM
It is. But you need to supply your own CNI manifest if you don't want to deploy one of the CNI's from the dropdown
c

crooked-cat-21365

02/13/2023, 9:13 AM
AFAICT there is no dropdown to select a CNI for K3s in Rancher v2.7.1. And the cluster.yaml doen't mention a CNI, either, but of course I will try your suggestion. Thank you very much.
a

agreeable-oil-87482

02/13/2023, 9:18 AM
Ah yes, you're right. You'd need to pass the equivalent of
--flannel-backend=none
. I've not tested this but in the cluster yaml in the
machineGlobalConfig
block add
flannel-backend: none
and supply the CNI manifest via addons or fleet etc
c

creamy-pencil-82913

02/13/2023, 5:53 PM
K3s only ships with a single CNI, unlike RKE2 which allows a selection. If you want to deploy your own you should do as David said.
c

crooked-cat-21365

02/14/2023, 10:44 AM
It turned out that the built-in Flannel in K3s is fine for my needs. I just got a problem with RKE2 (calico by default). Posted yesterday on the rke2 channel, but no reply yet.