Curated summary
Scaling Kubernetes to 2,500 nodes
Scaling Kubernetes to 2,500 Nodes for Deep Learning
OpenAI's deep learning research team ran Kubernetes for over two years and pushed one cluster to more than 2,500 nodes on Azure, mixing D15v2 and NC24 VMs. Along the way, nearly every major system component broke, including etcd, the kube-apiservers, Docker image pulls, networking, KubeDNS, and the ARP cache. The post walks through each failure and the specific fix, with the common theme that most problems came from default settings that did not hold up at scale.
etcd Performance and Storage Limits
- Past 500 nodes, researchers saw frequent kubectl timeouts. Adding more kube-apiserver replicas helped temporarily but stopped working past 10 replicas, which pointed to the real bottleneck: etcd.
- etcd write latency spiked to hundreds of milliseconds on network-attached P30 SSDs. Benchmarking with fio showed etcd used only about 10% of the disk's IOPS because its sequential writes were latency-bound at 2ms.
- Moving the etcd data directory to the instance's local SSD dropped write latency to 200µs and restored health.
- Past 1,000 nodes, the apiservers were reading over 500MB/s from etcd. Prometheus monitoring and audit logs (
--audit-log-path,--audit-log-maxbackup) revealed slow queries and heavy LIST calls on Events. - The root cause was Fluentd and Datadog querying the apiservers from every node. The team reduced their polling frequency, which stabilized apiserver load.
- Events were moved to a separate etcd cluster using
--etcd-servers-overrides, so bursts of Event creation would not affect the main cluster. - Hitting etcd's default 2GB storage limit stopped all writes, which made nodes fail health checks and caused the autoscaler to terminate workers. The fix was raising
--quota-backend-bytes, and the autoscaler gained a safeguard that refuses to act if it would remove more than 50% of the cluster.
Kube Master Configuration
- The kube-apiserver, kube-controller-manager, and kube-scheduler run colocated on at least two master machines for high availability.
--apiserver-countis set explicitly so Prometheus does not confuse instances. - Because the cluster is mainly used for batch workloads with autoscaling, the team reversed the default scheduler behavior. Instead of spreading pods evenly, they packed them using
MostRequestedPriorityandInterPodAffinityPriority, which lets idle nodes be terminated and leaves room for large pods.
KubeDNS Hotspots
- The new packing policy placed 10+ KubeDNS replicas on some machines. These hotspots exceeded the roughly 200 QPS per-VM limit Azure enforces on external DNS lookups.
- The fix was a
podAntiAffinityrule withkubernetes.io/hostnameas the topology key, which spreads KubeDNS pods across different nodes.
Docker Image Pulls
- The Dota image is about 17GB and took around 30 minutes to pull on a fresh node. Because kubelet's
--serialize-image-pullsdefaults to true, that single pull blocked every other image on the node. - Setting it to false required switching Docker's storage driver from AUFS to overlay2. The Docker root was also moved to the local SSD to speed up pulls.
- Large pulls were being canceled for lack of progress (
net/http: request canceled). The team raised--image-pull-progress-deadlineto 30 minutes and set Docker'smax-concurrent-downloadsto 10 to process the backlog in parallel. - Nodes reaching gcr.io through a NAT were hitting per-IP quota limits on the pause container image, which blocked all container starts. The fix was preloading that image, along with a whitelist of common internal images, into the worker machine image using
docker image saveanddocker image load.
Networking Overhead
- Direct machine-to-machine throughput was 10–15 Gbit/s, but pods on Flannel reached only about 2 Gbit/s on Azure. Flannel did not show this overhead on the team's physical machines, so the cause was environmental rather than misconfiguration.
- The workaround is
hostNetwork: truewithdnsPolicy: ClusterFirstWithHostNet, which bypasses Flannel for specific pods. The post cautions readers to review the Kubernetes documentation's warnings before using it.
ARP Cache Exhaustion
- Intermittent DNS failures and multi-second connection delays on a Redis host traced back to the kernel's ARP neighbor table. The dmesg log reported
neighbor table overflow!. - Every pod has its own IP address, so pods consume ARP entries quickly. The fix was raising
net.ipv4.neigh.default.gc_thresh1,gc_thresh2, andgc_thresh3in/etc/sysctl.confto 8000, 9000, and 100000. This is a common tuning step in HPC clusters.
Practical Takeaway
Scaling Kubernetes well past typical sizes depends less on any single fix than on checking default behavior at every layer: monitoring polling, storage latency, image pull settings, scheduler policy, DNS placement, and kernel networking limits. The team reported the clusters ran incident-free for about three months after these changes, and they had upgraded to Kubernetes 1.8.4, which officially supported 5,000 nodes.
Related reading
Continue with another curated summary.
GitLab2026-04-28 How to build CI/CD observability at scale
Read original
OpenAI2021-01-24 Scaling Kubernetes to 7,500 nodes
Read original
GitLab2026-05-07 Automate deployment processes with GitLab Duo Agent Platform
Read original
Cloudflare2026-03-26 A one-line Kubernetes fix that saved 600 hours a year
Read original