# 警告 FailedCreatePodSandBox：创建Pod沙箱失败：rpc错误：代码=未知 描述=无法为Pod设置沙箱容器""网络：networkPlugin cni无法为Pod "my-pod_default"设置网络：网络中没有可用IP地址

- **ID:** `cloud/azure-aks-pod-creation-pending-no-ip`
- **领域:** cloud
- **类别:** resource_error
- **错误码:** `FailedCreatePodSandBox`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

Azure Kubernetes Service (AKS)节点池已耗尽子网IP地址范围，阻止新Pod分配IP地址。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| AKS 1.26 | active | — | — |
| AKS 1.27 | active | — | — |
| Azure CNI | active | — | — |

## 解决方案

1. ```
   Increase the subnet size by adding a new subnet and updating the AKS cluster to use it. First, create a new subnet: `az network vnet subnet create --resource-group my-rg --vnet-name my-vnet --name new-subnet --address-prefixes 10.0.1.0/24` Then update the node pool: `az aks nodepool update --resource-group my-rg --cluster-name my-cluster --name my-nodepool --vnet-subnet-id /subscriptions/.../subnets/new-subnet`
   ```
2. ```
   Delete unused pods to free IPs. Use `kubectl delete pod <pod-name>` for non-critical pods. Then monitor with `kubectl get pods -o wide` to see IP reclamation.
   ```

## 无效尝试

- **Restart the AKS cluster** — Restarting does not free up IP addresses; the subnet is still full. (95% 失败率)
- **Scale down the node pool to reduce node count** — Scaling down reduces nodes but does not reclaim IPs from existing pods. Pod IPs remain allocated until pods are deleted. (80% 失败率)
