kubernetes
network_error
ai_generated
true
警告:服务'default/my-service'没有可用的端点
Warning: No endpoints available for service 'default/my-service'
ID: kubernetes/ingress-controller-no-endpoints
87%修复率
88%置信度
1证据数
2023-11-05首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| nginx-ingress-controller v1.9.5 | active | — | — | — |
| Kubernetes v1.27.3 | active | — | — | — |
| Kubernetes v1.28.2 | active | — | — | — |
根因分析
Ingress控制器无法找到引用服务的健康Pod端点,通常是因为服务选择器没有匹配到任何Pod或Pod未就绪。
English
The Ingress controller cannot find any healthy pod endpoints for the referenced service, often because the service selector doesn't match any pods or pods are not ready.
官方文档
https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/解决方案
-
Verify the service selector matches the pod labels: `kubectl get service my-service -n default -o jsonpath='{.spec.selector}'` and `kubectl get pods -n default --show-labels | grep my-service` -
Check pod readiness: `kubectl get pods -n default -l app=my-service -o wide` and ensure readiness probes pass. If pods are not ready, fix the probe configuration in the deployment.
无效尝试
常见但无效的做法:
-
Delete and recreate the Ingress resource
95% 失败
The Ingress resource is not the problem; the underlying service or pod configuration is misaligned. Recreating Ingress doesn't fix the endpoint mismatch.
-
Increase the number of replicas in the deployment
80% 失败
More replicas won't help if the service selector doesn't match the pod labels or if pods are failing readiness probes.