{
  "id": "kubernetes/hpa-missing-metrics-server",
  "signature": "Error: failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API",
  "signature_zh": "错误：无法获取CPU利用率：无法获取资源CPU的指标：无法从资源指标API获取指标",
  "regex": "failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API",
  "domain": "kubernetes",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Horizontal Pod Autoscaler (HPA) cannot query CPU/metrics because the metrics-server is not deployed or is not functioning correctly.",
  "root_cause_type": "generic",
  "root_cause_zh": "水平Pod自动缩放器（HPA）无法查询CPU/指标，因为metrics-server未部署或运行不正常。",
  "versions": [
    {
      "version": "metrics-server v0.6.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes v1.28.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes v1.29.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Install a custom Prometheus adapter instead of metrics-server",
      "why_fails": "HPA requires the resource metrics API, which is typically served by metrics-server. Prometheus adapter serves custom metrics, not resource metrics.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set --horizontal-pod-autoscaler-use-rest-clients=false on kube-controller-manager",
      "why_fails": "This flag is deprecated and removed in recent Kubernetes versions (1.23+). It no longer affects HPA behavior.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Deploy metrics-server using the official manifest: `kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml`",
      "success_rate": 0.85,
      "how": "Deploy metrics-server using the official manifest: `kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check metrics-server pod logs: `kubectl logs -n kube-system deployment/metrics-server` and verify it can connect to kubelets. Common fix: add --kubelet-insecure-tls flag if using self-signed certs.",
      "success_rate": 0.8,
      "how": "Check metrics-server pod logs: `kubectl logs -n kube-system deployment/metrics-server` and verify it can connect to kubelets. Common fix: add --kubelet-insecure-tls flag if using self-signed certs.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Deploy metrics-server using the official manifest: `kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml`",
    "Check metrics-server pod logs: `kubectl logs -n kube-system deployment/metrics-server` and verify it can connect to kubelets. Common fix: add --kubelet-insecure-tls flag if using self-signed certs."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-metrics-apis",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}