An HPA on a custom metric shows `<unknown>` and `unable to get metric http_requests_per_second: unable to fetch metrics from custom metrics API: the server could not find the descriptor for metric pods/http_requests_per_second`.
AdvancedTroubleshootingControl plane, RBAC, webhooks and autoscaling
Answer
Likely causes → The custom metrics adapter (prometheus-adapter, KEDA) does not expose that metric: the adapter rule's seriesQuery does not match, the metric lacks namespace/pod labels, or the name translation differs (_total stripped, _per_second added).
Diagnose →
kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 | jq -r '.resources[].name' | grep http
kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1/namespaces/shop/pods/*/http_requests_per_second" | jq
kubectl logs -n monitoring deploy/prometheus-adapter --tail=50
Fix → Fix the adapter rule so the series has namespace and pod labels and the name matches; or switch to KEDA's Prometheus scaler, which queries PromQL directly.
Prevent → Version adapter rules with the app's metrics; test with kubectl get --raw before wiring the HPA.
More on Control plane, RBAC, webhooks and autoscaling
A developer gets `Error from server (Forbidden): pods is forbidden: User "[email protected]" cannot list resource "pods" in API group "" in the namespace "payments"`.BeginnerA CI pipeline fails with `deployments.apps "api" is forbidden: User "system:serviceaccount:ci:deployer" cannot patch resource "deployments" in API group "apps" in the namespace "prod"`.BeginnerA user can `get pods` but `kubectl logs` fails with `cannot get resource "pods/log"` and `kubectl exec` fails with `cannot create resource "pods/exec"`.BeginnerCreating a RoleBinding fails with `is attempting to grant RBAC permissions not currently held`.IntermediateEvery `kubectl apply` fails with `Internal error occurred: failed calling webhook "validate.kyverno.svc-fail": failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/validate/fail?timeout=10s": context deadline exceeded`.AdvancedCreating a Certificate fails with `failed calling webhook "webhook.cert-manager.io": ... no endpoints available for service "cert-manager-webhook"`.Intermediate