kairen / kubeadm-ansible

Build a Kubernetes cluster using kubeadm via Ansible.
Apache License 2.0
724 stars 379 forks source link

Can't use pod-network-cidr with /25 netmask #59

Open michaelmior opened 5 years ago

michaelmior commented 5 years ago

I'm trying to specify a pod-network-cidr with a /25 netmask. I first had to specify node-cidr-mask-size by switching to using kubeadm-init.yml instead of CLI args. The cluster now starts and the nodes join just fine. On my master, I can see that the netmask is correctly specified (IP redacted):

$  kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'
X.X.X.X/25

However, when I try to actually deploy anything, it fails and I get the message below:

  Warning  FailedCreatePodSandBox  9m25s                    kubelet, node02   Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "211a1decea926872a991ecd80eb45f70fdadf7085c69323c733950d9bb84cd0a" network for pod "nginx-deployment-6dd86d77d-xtv2w": NetworkPlugin cni failed to set up pod "nginx-deployment-6dd86d77d-xtv2w_default" network: open /run/flannel/subnet.env: no such file or directory
  Normal   SandboxChanged          9m22s (x12 over 9m33s)   kubelet, node02   Pod sandbox changed, it will be killed and re-created.

Any assistance would be appreciated :)