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:

  1. K8S Performance Optimization - OS sysctl Tuning
  2. 《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 /10to support environments with more than 500 nodes.

Detailed description

Premise: Overlay network

  1. Assume that hostPrefix is on 1 node /24, then this machine theoretically has 254 pod IPs.
    1. The cluster network CIDR is /21, theoretically cluster up to 8 machines;
    2. The cluster network CIDR is /20, 16 units;
    3. /18, 64 units;
    4. /17, 128 units;
    5. /16, 256 units;
    6. /15, 512 units;
  2. Assume that hostPrefix is on 1 node /23, then this machine theoretically has 510 pod IPs.
    1. The cluster network CIDR is /20, theoretically cluster up to 8 machines;
    2. The cluster network CIDR is /19, 16 units;
    3. /17, 64 units;
    4. /16, 128 units;
    5. /15, 256 units;
    6. /14, 512 units; (As a caution, we recommend setting it to if the cluster size exceeds 500.) /12 or /10)。

EOF


K8S Performance Optimization - CIDR configuration for large clusters
https://e-whisper.com/posts/21327/
Author
east4ming
Posted on
January 14, 2022
Licensed under