kubernetescni

Cleaning up installed cni-pluggins


I am bit stuck with a problem I have.

I am struggling to set up the cni-plugin for k8. I was trying to install different cni-plugins that now I think many things are messed up.

Is there a way to neatly delete everything connected with a cni-plugin so that I can have a clean starting point? The goal is to avoid formatting my whole machine.


Solution

  • From this Stack Question.

    ​ steps to remove old calico configs from kubernetes without kubeadm reset:

    1. clear ip route: ip route flush proto bird

    2. remove all calico links in all nodes ip link list | grep cali | awk '{print $2}' | cut -c 1-15 | xargs -I {} ip link delete {}

    3. remove ipip module modprobe -r ipip

    4. remove calico configs rm /etc/cni/net.d/10-calico.conflist && rm /etc/cni/net.d/calico-kubeconfig

    5. restart kubelet service kubelet restart

    After those steps all the running pods won't be connect, then I have to delete all the pods, then all the pods works. This has litter influence if you are using replicaset

    Or else you can use:

    kubeadm reset command. this will un-configure the kubernetes cluster.