How can I switch the default CNI providers in a K8s cluster

7/21/2019

Throughout the kubernetes documentation I noticed how to setup a CNI provider using the --cni-conf-dir and --cni-bin-dir. It is mentioned that "If there are multiple CNI configuration files in the directory, the first one in lexicographic order of file name is used."

If I want to switch between the default CNI provider what is the best way. Do I need to rename the configuration files to follow the lexicographic order ? For example if I want to use a bridge or macvlan cni provider instead of flannel what should I do ?

-- user3364247
cni
kubeadm
kubectl
kubernetes
networking

1 Answer

7/23/2019

Most seem to use 10-<cni>.conf to 99-<cni>.conf, similar to systemd file naming conventions, to ensure an order. But there is no official naming convention as of yet.

For an example of switching providers see this stack overflow answer.

-- char
Source: StackOverflow