Failed to create pod sandbox kubernetes cluster

achahbar picture achahbar · Mar 14, 2018 · Viewed 8.5k times · Source

I have an weave network plugin.

inside my folder /etc/cni/net.d there is a 10-weave.conf

{
"name": "weave",
"type": "weave-net",
"hairpinMode": true
}

My weave pods are running and the dns pod is also running But when i want to run a pod like a simple nginx wich will pull an nginx image The pod stuck at container creating , describe pod gives me the error , failed create pod sandbox.

When i run journalctl -u kubelet i get this error

cni.go:171] Unable to update cni config: No networks found in /etc/cni/net.d

is my network plugin not good configured ?

i used this command to configure my weave network

kubectl apply -f https://git.io/weave-kube-1.6

After this won't work i also tried this command

kubectl apply -f “https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d ‘\n’)”

I even tried flannel and that gives me the same error. The system i am setting kubernetes on is a raspberry pi. I am trying to build a raspberry pi cluster with 3 nodes and 1 master with kubernetes

Dose anyone have ideas on this?

Answer

achahbar picture achahbar · Mar 15, 2018

Thank you all for responding to my question. I solved my problem now. For anyone who has come to my question in the future the solution was as followed.

I cloned my raspberry pi images because i wanted a basicConfig.img for when i needed to add a new node to my cluster of when one gets down.

Weave network (the plugin i used) got confused because on every node and master the os had the same machine-id. When i deleted the machine id and created a new one (and reboot the nodes) my error got fixed. The commands to do this was

sudo rm /etc/machine-id sudo rm /var/lib/dbus/machine-id sudo dbus-uuidgen --ensure=/etc/machine-id

Once again my patience was being tested. Because my kubernetes setup was normal and my raspberry pi os was normal. I founded this with the help of someone in the kubernetes community. This again shows us how important and great are IT community is. To the people of the future who will come to this question. I hope this solution will fix your error and will decrease the amount of time you will be searching after a stupid small thing.