无法检索Heapster Metric模型

时间:2017-11-06 20:06:58

标签: kubernetes heapster

我正在GKE上运行我的kubernetes v1.6.11-gke.0群集。 在群集中,heapster-v1.3.0(gcr.io/google_containers/heapster-amd64:v1.3.0)窗格正在运行。

但是,当尝试通过REST API检索heapster指标时,似乎存在问题,如下所示:

localhost:8001/api/v1/model/metrics
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource",
  "reason": "NotFound",
  "details": {},
  "code": 404
}

localhost:8001/api/v1/proxy/namespaces/kube-system/services/heapster/
404 page not found

此外,kube-dns似乎也无法访问

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "no endpoints available for service \"kube-dns\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

使用kubectl cluster-info服务似乎运作良好。

有关从何处开始调试问题的建议?

更新 kubectl get pods -n kube-system

的结果
fluentd-gcp-v2.0-jp9qq                               2/2       Running   0          87d
fluentd-gcp-v2.0-s2hpp                               2/2       Running   0          19h
fluentd-gcp-v2.0-xlbq2                               2/2       Running   0          19h
heapster-v1.3.0-1288166888-2j4b2                     2/2       Running   0          19h
kube-dns-323615064-49klg                             3/3       Running   0          19h
kube-dns-autoscaler-2667913178-dv2s3                 1/1       Running   0          19h
kube-proxy-gke-acme-air-default-pool-c005178d-gkq6   1/1       Running   0          19h
kube-proxy-gke-acme-air-default-pool-c005178d-n3l7   1/1       Running   0          19h
kube-proxy-gke-acme-air-default-pool-c005178d-v9nn   1/1       Running   0          19h
kubernetes-dashboard-2917854236-wgh8f                1/1       Running   0          19h
l7-default-backend-1044750973-h5s9g                  1/1       Running   0          19h

kubectl get svc -n kube-system

的结果
NAME                   CLUSTER-IP     EXTERNAL-IP   PORT(S)         AGE
default-http-backend   10.43.249.84   <nodes>       80:31149/TCP    160d
heapster               10.43.242.96   <none>        80/TCP          160d
kube-dns               10.43.240.10   <none>        53/UDP,53/TCP   160d
kubernetes-dashboard   10.43.243.31   <none>        80/TCP          160d

1 个答案:

答案 0 :(得分:0)

Heaspter metrics API将通过Heapster服务访问,而不是主API。模型API的路径是http://localhost:8001/api/v1/proxy/namespaces/kube-system/services/heapster/api/v1/model/metrics而不是localhost:8001/api/v1/model/metrics