kubernetes resource_error ai_generated true

无法为范围 0 分配:范围 10.244.0.0/16 中没有可用的 IP 地址

failed to allocate for range 0: no IP addresses available in range: 10.244.0.0/16

ID: kubernetes/pod-network-ip-exhaustion

其他格式: JSON · Markdown 中文 · English
78%修复率
85%置信度
1证据数
2024-02-20首次发现

根因分析

Pod CIDR 范围已耗尽,因为调度了太多 pod 或 IP 地址释放存在泄漏,通常是由于 CNI 插件错误。

English

The pod CIDR range is exhausted because too many pods are scheduled or there's a leak in IP address release, often due to a CNI plugin bug.

generic

官方文档

https://kubernetes.io/docs/concepts/cluster-administration/networking/#pod-cidr

解决方案

  1. Flush the CNI IPAM database: For Calico, run 'calicoctl ipam release --ip=<specific-ip>' or 'calicoctl ipam release --all' to release unused IPs.
  2. Scale down unnecessary deployments to free pod IPs: 'kubectl scale deployment <name> --replicas=0' then scale back up.

无效尝试

常见但无效的做法:

  1. Restart all pods to release IPs 80% 失败

    Restarting pods doesn't force the CNI to release stale IPs; the allocation table remains full.

  2. Increase the pod CIDR size in kube-controller-manager 70% 失败

    Changing CIDR requires cluster reinitialization and doesn't free existing IPs; it's a complex operation with downtime.