K8S Performance Optimization - CIDR configuration for large clusters
This article was last updated on: July 24, 2024 am
preface
This is the third article in the K8S performance optimization series: CIDR configuration best practices for large Kubernetes clusters.
Series:
- K8S Performance Optimization - OS sysctl Tuning
- 《K8S Performance Optimization - K8S APIServer Tuning》
CIDR configuration
When installing a large cluster or scaling an existing cluster to a larger scale, you might not be able to use the commonly used cluster network CIDR if the cluster has more than 500 nodes when you install the cluster setup cluster network CIDR /14
(The assumption here is that a Node’s hostPrefix is.) /23
, then theoretically there are more than 512 machines, and the cluster network IP is not enough). In this case, it must be set to /12
or /10
to support environments with more than 500 nodes.
Detailed description
Premise: Overlay network
- Assume that hostPrefix is on 1 node
/24
, then this machine theoretically has 254 pod IPs.- The cluster network CIDR is
/21
, theoretically cluster up to 8 machines; - The cluster network CIDR is
/20
, 16 units; - …
/18
, 64 units;/17
, 128 units;/16
, 256 units;/15
, 512 units;
- The cluster network CIDR is
- Assume that hostPrefix is on 1 node
/23
, then this machine theoretically has 510 pod IPs.- The cluster network CIDR is
/20
, theoretically cluster up to 8 machines; - The cluster network CIDR is
/19
, 16 units; - …
/17
, 64 units;/16
, 128 units;/15
, 256 units;/14
, 512 units; (As a caution, we recommend setting it to if the cluster size exceeds 500.)/12
or/10
)。
- The cluster network CIDR is
EOF