Skip to main content

Command Palette

Search for a command to run...

[Solved] pod CIDR not assigned

Updated
1 min readView as Markdown
A

Hi This is Abhishek Singh, Devops Engineer by profession and Gamer by passion. I'm a devops engineer with more than 3 years of experience in Linux, Monitoring and Devops. I'm huge Open source supporter and Linux lover. In free time I love to play Minecraft and Valorant.

In some cases while adding worker node in existing cluster you may get following error -

Error registering network: failed to acquire lease: node "worker-no-xx" pod cidr not assigned

How to identify the error -

Canal pod will restart again and again, check the log of that pod and you will get the above mentioned error in the log window.

How to fix -

First identify the podcidr of your existing nodes in your cluster using following command-

kubectl get no -o yaml | grep -i podcidr

You will get podcidrs of all the existing nodes -

Output -

    podCIDR: 10.244.2.0/24
    podCIDRs:
    podCIDR: 10.244.1.0/24
    podCIDRs:
    podCIDR: 10.244.3.0/24
    podCIDRs:
    podCIDR: 10.244.0.0/24
    podCIDRs:

Now patch you new node with podcidr by running following command -

kubectl patch node 123-98-15.hostname.net -p '{"spec":{"podCIDR":"10.244.4.0/24"}}'

Please avoid any type of conflict while patching the node.

Thanks

Follow me on twitter @thesniperxjohn

More from this blog

O

Opscribe | Inspire. Innovate. Inform.

20 posts

Opscribe is your go-to hub for captivating tech stories. We explore the realms of DevOps, cloud, automation, and AI, offering insightful articles that demystify these cutting-edge fields.