1

I'm running kubernetes with the supposed pod network cidr of 10.244.0.0/16. Everything seems to agree with that:

# history | grep kubeadm
kubeadm init --control-plane-endpoint "guide:6443" --upload-certs --pod-network-cidr=10.244.0.0/16

$ kubectl get nodes -o kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'
10.244.0.0/24 10.244.1.0/24 10.244.2.0/24 10.244.3.0/24 10.244.4.0/24 10.244.5.0/24

# cat /run/flannel/subnet.env 
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true

However all the pods I create get IPs in the 172.17.0.0/16 range.

$ kubectl get pods -o wide
NAME                                   READY   STATUS             RESTARTS   AGE   IP            NODE         NOMINATED NODE   READINESS GATES
busybox1                               1/1     Running            1          13m   172.17.0.11   k8s-node-1   <none>           <none>
debain-shell-547f8fc54b-v8p99          0/1     ImagePullBackOff   0          27m   172.17.0.3    k8s-node-1   <none>           <none>
nginx-deployment-ex-54f57cf6bf-k55nn   1/1     Running            1          27m   172.17.0.5    k8s-node-1   <none>           <none>
nginx-deployment-ex-54f57cf6bf-q2khx   1/1     Running            1          27m   172.17.0.9    k8s-node-1   <none>           <none>
nginx-deployment-ex-54f57cf6bf-r8b7v   1/1     Running            1          27m   172.17.0.7    k8s-node-1   <none>           <none>

I can't talk to coredns (which is how I found this condition) and I can't seem to use my ingress service anymore (though I've restarted enough things by now I may have just temporarily broken that).

What is causing this, or alternatively, where should I look for more info?

1 Answer 1

2

This was caused by missing --network-plugin=cni on the end of kubelet. Added that to the args and it all works now.

2
  • Hello Alex. I am facing exactly same issue in my cluster. Same range of unexpected CIDR is used for IP allocation. Can you share some detail how did you pass --network-plugin=cni in kubelet. I install kubelet by apt-get install kubelet. I am new to kubernetes. Thanks in advance.
    – Mufazzal
    Commented May 21, 2022 at 6:49
  • Sorry, I don't check my account often. I'm on gentoo and there it's in the /etc/conf.d/kubelet file. However I'm pretty sure it's not going to be the same on a debian based distro, sorry (esp to anyone else who comes across this). Commented Oct 26, 2023 at 20:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.