2

I have 3 masters, several workers and Calico as cni. Pods created on masters get 172.17.0.* IPs and this is docker network. Pods on workers get IP from calico pool as it should be. calicoctl shows status ok for all nodes.

Also I have same kubelet parameters and config files and I don't have any pod cidr settings there. Kube-system/calico pods are up and running and logs do not show any reason. How can I set correct cidr for pods on masters?

kubectl describe node master1 | egrep -i 'cidr|calico': 

    projectcalico.org/IPv4Address: 192.168.0.26/24
    projectcalico.org/IPv4IPIPTunnelAddr: 10.129.40.64
    PodCIDR:                      10.128.0.0/24
    PodCIDRs:                     10.128.0.0/24

pod details:

kubectl describe po mypod | egrep -i 'master|ip'
Node:         master1/192.168.0.26
IP:           172.17.0.3
IPs:
  IP:           172.17.0.3
Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
mzv
  • 187
  • 1
  • 3
  • 11
  • How did you setup your cluster, which solution did you use (kubeadm, kubespray etc..)? How did you install Docker and configure it with Kubernetes? How did you install Calico - did you used some flags for setting IPs? What are differences between masters and workers, do they have the same OS, are they configured the same way? Please add more information, so your issue [will be reproducible](https://stackoverflow.com/help/minimal-reproducible-example). – Mikolaj S. Nov 26 '21 at 14:11
  • Hi Micolaj, I was hoping for a quick solution which I have found. I needed to add "--network-plugin=cni" to kubelet startup options. It still puzzles me why it works on workers without this option though. – mzv Nov 29 '21 at 15:41
  • Please provide answers for questions from my previous comment, so I will be able to replicate this locally and find why it's behaving it's in this way ;) – Mikolaj S. Nov 29 '21 at 15:57
  • It was installed via custom tool, so I can't tell for sure what could be wrong or different. I can only check current settings, and from what I see they all are the same (versions, configs, OS) – mzv Nov 30 '21 at 08:55

1 Answers1

1

Posted community wiki based on comments for better visibility. Feel free to expand it.


The solution for the issue is to add flag --network-plugin=cni to Kubelet startup options on the masters nodes (from the @mzv comment):

I needed to add "--network-plugin=cni" to kubelet startup options

Instructions on how to add this flag to the Kubelet can be found here.

Mikolaj S.
  • 2,850
  • 1
  • 5
  • 17