What’s the Best Size for Cluster and Service CIDRs in Kubernetes?

0
0
Asked By TechWizard92 On

I'm facing an issue with IP address overlap in my Kubernetes clusters, especially while integrating load balancers using Calico and BGP routing. Initially, we used the same cluster and service CIDRs across multiple clusters, leading to confusion when clusters had pods with the same IP address (like 10.10.10.176). Now, we're planning to assign unique, non-overlapping CIDR ranges to each cluster, but I'm looking for advice on how large these ranges should be. Currently, we use around 176 pod IPs and 73 service IPs per cluster. Default settings seem to allocate a /16 network for both the pod and service networks, which is overkill for our needs and consumes too much private IP space. Is it okay to downsize to a /17, /18, or /19? How realistic is it to think we would ever need more than 8,000 IPs in a single cluster? I'm also curious about any real-world examples of using smaller CIDRs. I want to make sure we don't cut ourselves short for future expansion. Also, I've heard about the possibility of adding extra CIDRs later on. Any thoughts?

2 Answers

Answered By CloudGazer77 On

You can definitely downsize your CIDR if you're not using all those IPs. In recent Kubernetes versions, you can add additional CIDRs later on, which makes it easier to manage. But it sounds like a single LoadBalancer for multiple clusters might be overcomplicating your setup. Have you considered keeping things simpler by separating the load balancing for each cluster? It could save you some headaches in the long run.

Answered By SysAdminNerd33 On

If you're running everything on-premise and not using VPCs, you need to be more cautious with your CIDR allocations. Since you mentioned that each cluster shares the same environment, overlapping IPs can be a real pain. But if they’re in separate networks, the defaults might actually work. Just make sure to size according to both your current and future workloads.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.