In my case, dashboard-metrics-scraper does not work. Is there any suggestion?
- My test environment is kubernetes 1.20.4.
kubectl top nodes/pods
are works fine
Following commands do NOT work
- on kubernetes-dashboard log
2021/03/22 06:58:35 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
2021/03/22 06:59:05 Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.
- on console
with adding /proxy/healthz
goes bad request. If it is removing this (/proxy/healthz
), it works fine.
$ kubectl get --raw "/api/v1/namespaces/kubernetes-dashboard/services/dashboard-metrics-scraper/proxy/healthz"
Error from server (BadRequest): the server rejected our request for an unknown reason
Following commands WORK FINE
- wget from container
kubectl exec -it busybox -- wget --spider http://dashboard-metrics-scraper.kubernetes-dashboard.svc.cluster.local:8000
Connecting to dashboard-metrics-scraper.kubernetes-dashboard.svc.cluster.local:8000 (10.110.73.42:8000)
- kubectl proxy seems work, but it is redirected.
$ curl http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/http:dashboard-metrics-scraper:/proxy/healthz
<HTML><HEAD>
<TITLE>Redirect</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Redirect (authentication_redirect_to_virtual_host)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
You are being redirected to the authentication virtual host.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>
- kubectl get --raw to dashboard-metrics-scraper works fine (but if it is adding
/proxy/healthz
, it does not work.
$ kubectl get --raw "/api/v1/namespaces/kubernetes-dashboard/services/dashboard-metrics-scraper"
{"kind":"Service","apiVersion":"v1","metadata":{"name":"dashboard-metrics-scraper","namespace":"kubernetes-dashboard","uid":"43f83d61-81b2-4d57-8321-516158444cd1","resourceVersion":"6033988","creationTimestamp":"2021-03-22T02:53:15Z","labels":{"k8s-app":"dashboard-metrics-scraper"},"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"k8s-app\":\"dashboard-metrics-scraper\"},\"name\":\"dashboard-metrics-scraper\",\"namespace\":\"kubernetes-dashboard\"},\"spec\":{\"ports\":[{\"port\":8000,\"targetPort\":8000}],\"selector\":{\"k8s-app\":\"dashboard-metrics-scraper\"}}}\n"},"managedFields":[{"manager":"kubectl-client-side-apply","operation":"Update","apiVersion":"v1","time":"2021-03-22T02:53:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:kubectl.kubernetes.io/last-applied-configuration":{}},"f:labels":{".":{},"f:k8s-app":{}}},"f:spec":{"f:ports":{".":{},"k:{\"port\":8000,\"protocol\":\"TCP\"}":{".":{},"f:port":{},"f:protocol":{},"f:targetPort":{}}},"f:selector":{".":{},"f:k8s-app":{}},"f:sessionAffinity":{},"f:type":{}}}}]},"spec":{"ports":[{"protocol":"TCP","port":8000,"targetPort":8000}],"selector":{"k8s-app":"dashboard-metrics-scraper"},"clusterIP":"10.110.73.42","clusterIPs":["10.110.73.42"],"type":"ClusterIP","sessionAffinity":"None"},"status":{"loadBalancer":{}}}
dashboard-metrics-scraper
service seems work
$ kubectl describe svc -n kubernete
s-dashboard dashboard-metrics-scraper
Name: dashboard-metrics-scraper
Namespace: kubernetes-dashboard
Labels: k8s-app=dashboard-metrics-scraper
Annotations: <none>
Selector: k8s-app=dashboard-metrics-scraper
Type: ClusterIP
IP Families: <none>
IP: 10.110.73.42
IPs: 10.110.73.42
Port: <unset> 8000/TCP
TargetPort: 8000/TCP
Endpoints: 172.16.8.142:8000
Session Affinity: None
Events: <none>