503
kubernetes
runtime_error
ai_generated
true
来自服务器的错误(服务不可用):服务器当前无法处理请求(获取 apiservices.apiregistration.k8s.io v1.metrics.k8s.io)
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get apiservices.apiregistration.k8s.io v1.metrics.k8s.io)
ID: kubernetes/apiservice-not-available
78%修复率
82%置信度
1证据数
2024-01-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| Kubernetes 1.26 | active | — | — | — |
| Kubernetes 1.28 | active | — | — | — |
| metrics-server 0.6.3 | active | — | — | — |
根因分析
指标(或其他扩展)的 API 服务未响应,通常是因为相应的控制器(如 metrics-server)已关闭、配置错误或服务端点不可达。
English
The API service for metrics (or another extension) is not responding, often because the corresponding controller (e.g., metrics-server) is down, misconfigured, or the service endpoint is unreachable.
官方文档
https://kubernetes.io/docs/tasks/debug/debug-cluster/resource-metrics-pipeline/#metrics-server解决方案
-
Check the status of the extension API server pod, e.g., for metrics-server: `kubectl get pods -n kube-system | grep metrics-server`. If down, check logs: `kubectl logs -n kube-system <metrics-server-pod>`.
-
Verify the service endpoint for the API service: `kubectl get endpoints -n kube-system <service-name>`. If no endpoints, the pod may not be listening on the correct port.
-
Delete and recreate the APIService resource to force re-registration: `kubectl delete apiservice v1.metrics.k8s.io && kubectl apply -f metrics-server-apiservice.yaml`.
无效尝试
常见但无效的做法:
-
80% 失败
Restarting the kube-apiserver pod does not fix the issue because the problem is with the extension API server, not the core API server.
-
60% 失败
Reapplying the APIService YAML without checking the underlying service status may lead to the same error if the service is still down.