0

I'm trying to configure a kubernetes cluster with 1 master and 2 workers after doing all the configuration and initializing the cluster I keep getting pending status on coredns

kube-system   coredns-f9fd979d6-7c7fp                 0/1     Pending   0          26h   <none>         <none>          <none>           <none>                 
kube-system   coredns-f9fd979d6-xpf6d                 0/1     Pending   0          26h   <none>         <none>          <none>           <none>
kube-system   etcd-l00301c002075                      1/1     Running   0          26h   10.87.22.132   l00301c002075   <none>           <none>
kube-system   kube-apiserver-l00301c002075            1/1     Running   0          26h   10.87.22.132   l00301c002075   <none>           <none>
kube-system   kube-controller-manager-l00301c002075   1/1     Running   1          26h   10.87.22.132   l00301c002075   <none>           <none>
kube-system   kube-proxy-mrzbx                        1/1     Running   0          26h   10.87.22.132   l00301c002075   <none>           <none>
kube-system   kube-scheduler-l00301c002075            1/1     Running   1          26h   10.87.22.132   l00301c002075   <none>           <none>

here the output of the kubelet status

L00301C002075 kubelet[3996]: W1126 16:10:01.023901    3996 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
Nov 26 16:10:03 L00301C002075 kubelet[3996]: E1126 16:10:03.242440    3996 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Nov 26 16:10:06 L00301C002075 kubelet[3996]: W1126 16:10:06.024105    3996 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
Nov 26 16:10:08 L00301C002075 kubelet[3996]: E1126 16:10:08.243924    3996 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Nov 26 16:10:11 L00301C002075 kubelet[3996]: W1126 16:10:11.024305    3996 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
Nov 26 16:10:13 L00301C002075 kubelet[3996]: E1126 16:10:13.245176    3996 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Nov 26 16:10:16 L00301C002075 kubelet[3996]: W1126 16:10:16.024604    3996 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
Nov 26 16:10:18 L00301C002075 kubelet[3996]: E1126 16:10:18.246664    3996 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized
Nov 26 16:10:21 L00301C002075 kubelet[3996]: W1126 16:10:21.024786    3996 cni.go:239] Unable to update cni config: no networks found in /etc/cni/net.d
Nov 26 16:10:23 L00301C002075 kubelet[3996]: E1126 16:10:23.248173    3996 kubelet.go:2103] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

i tried to follow this solution but it wasn't working for me

Coredns in pending state in Kubernetes cluster

does anyone have further suggestions?

While the output of status kubelet

alelusi
  • 1
  • 2
  • That must be exactly what it says. Have you tried to install a CNI plugin? Which one? If no, start here. https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network. Than you'll need to choose a plugin. Usually Flannel is the best option for beginners. https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/#pod-network – Olesya Bolobova Nov 27 '20 at 01:50

1 Answers1

0

You should boostrap your cluster with a Network CNI, for example Calico which is officially supported by Kubernetes.

First run kubeadm init with correct pod-network-cidr:

sudo kubeadm init --pod-network-cidr=192.168.0.0/16 --<additional-flags>

After cluster is deployed run following commands:

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Once done you can install Calico:

kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
kubectl create -f https://docs.projectcalico.org/manifests/custom-resources.yaml

When calico pods are successfully deployed CoreDNS will start autimatically.

Then you can add nodes to your cluster using kubeadm join command.

kool
  • 3,214
  • 1
  • 10
  • 26