How to do i get rid of this error "network: stat /var/lib/calico/nodename: no such file or directory" on Kubernetes

4/6/2020

I uninstalled calico using: 'kubectl delete -f calico.yaml'

and installed weave using: 'export kubever=$(kubectl version | base64 | tr -d '\n')' 'kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"'

When i deploy my pods they remain at "ContainerCreating" status. When i check pod logs i see error below:

'networkPlugin cni failed to set up pod "saccofrontend-d7444fd6d-998gf_default" network: stat /var/lib/calico/nodename: no such file or directory: check that the calico/node container is running and has mounted /var/lib/calico/'

I manually deleted this file. A reinstall of docker and kubeadm did not help either.Still getting the same error.

Please advise what could be promting kubelet to still use calico as the cni even though i unstialled it.

-- Tariq Ondego
calico
cni
kubelet
kubernetes
weave

1 Answer

4/7/2020

thank you for pointing me in the right direction: These cmds solved the problem: rm -rf /var/lib/cni rm -rf /etc/cni/net.d

then re-installed kubeadm

-- Tariq Ondego
Source: StackOverflow