DEV Community

perber
perber

Posted on

1

Resolving `CIDRNotAvailable` Error in Talos Linux (Kubernetes Distribution) with Calico CNI

Hi everyone,

This is my first post in quite some time! Today, I’d like to dive into a troubleshooting topic that I recently encountered and share how we resolved it in our Talos setup. Hopefully, this will help others facing a similar issue.

The Problem

We use Calico with BGP for networking in our Kubernetes setup. Recently, one of our nodes started showing the following event:

cidrAllocator Node node-1 status is now: CIDRNotAvailable
Enter fullscreen mode Exit fullscreen mode

Interestingly, the cluster remained operational, and Pods were still accessible. However, it was clear that the error indicated a misconfiguration that needed to be addressed.

After reaching out to the Calico community, they quickly pointed out the root cause: the podCIDR allocation was still being handled by the Kubernetes controller manager. When using Calico IPAM, the controller manager should not assign IP addresses to Pods.

The Solution

To resolve this issue, we needed to disable podCIDR allocation in the controller manager. Here’s how we implemented the fix in Talos Linux.

Step 1: Update the Controller Manager Configuration

In Talos, you can update the controller manager configuration to disable IP allocation. Add the following configuration snippet to your Talos cluster manifest:

controllerManager:
    image: registry.k8s.io/kube-controller-manager:v1.26.2
    # Disable IP allocations in the controller manager.
    # This change resolves the CIDRNotAvailable error.
    extraArgs:
        allocate-node-cidrs: false

Enter fullscreen mode Exit fullscreen mode

Step 2: Apply the Changes

Once you apply the updated configuration, the kube-controller-manager Pods will restart automatically. The allocate-node-cidrs setting should now be disabled.

You can verify the updated configuration by describing the kube-controller-manager Pod:

kubectl describe pod -n kube-system kube-controller-manager-<clustername>
Enter fullscreen mode Exit fullscreen mode

Here is an example of the expected output:

Command:
  /usr/local/bin/kube-controller-manager
  ...
  --allocate-node-cidrs=false
  ...

Enter fullscreen mode Exit fullscreen mode

Note the line --allocate-node-cidrs=false in the Command section—this confirms that the setting has been correctly applied.

It will take sometime until the error CIDRNotAvailable is not longer visible.

Billboard image

Deploy and scale your apps on AWS and GCP with a world class developer experience

Coherence makes it easy to set up and maintain cloud infrastructure. Harness the extensibility, compliance and cost efficiency of the cloud.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay