症状
API 服务器以 exceeded quota 拒绝创建 Pod。Deployment 停滞或无法滚动前进,而已有 Pod 仍在运行。
诊断
对比使用量与上限,并统计 Pod:
kubectl describe resourcequota -n prod
kubectl get pods -n prod --field-selector status.phase!=Running
已完成的 Pod 往往仍占用 Pod 数量配额。
修复
释放配额并调整 requests:
kubectl delete pod -n prod --field-selector status.phase=Succeeded
resources:
requests: { cpu: "100m", memory: "128Mi" } # fit within remaining quota
验证
重新 apply 该 Deployment;Pod 被接纳,kubectl describe resourcequota 显示每个维度的 Used 都低于 Hard 上限,确认配额不再阻塞。