for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Metrics server not working on 4.7.0

Open zamu87 opened this issue 4 years ago • 24 comments

  • [x] I have tried with the latest version of Docker Desktop
  • [x] I have tried disabling enabled experimental features
  • [ ] I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Metrics server running

Actual behavior

Metrics server cannot start and logs the following error:

E0411 13:39:34.578401       1 scraper.go:140] "Failed to scrape node" err="Get \"https://192.168.65.4:10250/metrics/resource\": context deadline exceeded" node="docker-desktop"
I0411 13:39:40.241772       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"

Information

Metrics server works correctly on 4.6.1 and on 4.7.0 preview (76176)

  • macOS Version: 12.3.1
  • Intel chip or Apple chip: M1 Pro
  • Docker Desktop Version: 4.7.0 (77141)

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0017: can a VM be started?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
No fatal errors detected.

Steps to reproduce the behavior

  1. Install Docker Desktop 4.7.0
  2. Install metrics server kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
  3. Add "--kubelet-insecure-tls" under the args section of metrics server deployment

zamu87 avatar Apr 11 '22 13:04 zamu87

i am seeing the same issue.. following..

ncresswell avatar Apr 12 '22 04:04 ncresswell

i have the same problem

wang-mask avatar Apr 12 '22 23:04 wang-mask

same here

antoinedray avatar Apr 14 '22 19:04 antoinedray

same here

raulpuente avatar Apr 19 '22 17:04 raulpuente

I have solved this problem, you can try to set the --metric-resolution flag of metrics-server to 30s or longer. To see the detail https://github.com/kubernetes-sigs/metrics-server/issues/907

wang-mask avatar Apr 20 '22 01:04 wang-mask

In general scraping of kubelet /metrics takes more than 50 seconds using kubernetes in docker desktop on Apple M1.
In my case really --metric-resolution=90s solved the problem but the time is terrible.

VtG242 avatar Apr 21 '22 13:04 VtG242

I am having the same issue. So far I can get it to work if I increase the scrape interval all the way to 120s, but that's a workaround rather than a fix.

Can anyone from the Docker team(s) responsible for this product speak to way the kubelet takes so long to respond to the metrics endpoint?

alanbrent avatar May 12 '22 19:05 alanbrent

I tried the suggested increase of resolution to --metric-resolution=120s and still fails. The ...context deadline exceeded is gone, but I still get

I0602 07:25:09.859415       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"

eldada avatar Jun 02 '22 07:06 eldada

same here,and how to solve it?

vkeeps avatar Jun 09 '22 10:06 vkeeps

same here,any update?

gansongyuan avatar Jun 17 '22 07:06 gansongyuan

@eldada In my case with --metric-resolution=90s, the metrics server worked after waiting 90 seconds. It might waits for scraping the metrics

I0617 12:27:19.023258       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:27:29.015066       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:27:39.021942       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:27:49.021978       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:27:59.025582       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:28:09.022221       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:28:19.025656       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:28:29.026233       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:28:39.026624       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0617 12:28:49.027680       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"

bconfiden2 avatar Jun 17 '22 12:06 bconfiden2

same here on 4.9.1 I0618 02:40:32.115542 1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController I0618 02:40:32.115590 1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0618 02:40:59.510857 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:09.509626 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:19.510075 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:29.510229 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:39.510356 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:49.510741 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:52.173745 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:41:59.512561 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:09.512245 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:19.510408 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:29.510170 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:39.510117 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:49.511055 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:42:59.510729 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:43:09.511510 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:43:18.174487 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0618 02:43:19.512251 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"

phxism avatar Jun 18 '22 02:06 phxism

I'm having the same issue on Docker Desktop for Windows v4.9.1. I'll open another issue in that repository, but wanted to chime in that it doesn't seem platform specific. I'm going to try downgrading to 4.6.1 in the meantime.

Edit: Metrics server is working on Docker Desktop for Windows v4.6.1.

appellod avatar Jun 18 '22 14:06 appellod

same here

danielsollondon avatar Jul 06 '22 23:07 danielsollondon

same here. Docker desktop 4.10

chrlic avatar Jul 14 '22 11:07 chrlic

same here

ch1seL avatar Aug 01 '22 14:08 ch1seL

Same issue here.

marc-wilson avatar Aug 03 '22 07:08 marc-wilson

i have sort of dumb work around . Removed the readinessProbe and it worked . Docker for Desktop V1.24.2 (Mac M1).

FunkyPedro avatar Aug 17 '22 23:08 FunkyPedro

Same here on Mac M1 Pro ! I actually change the --metric-resolution=90s and the pod is running and up but can not get metrics so far.

I0921 01:17:15.283237 1 serving.go:342] Generated self-signed cert (/tmp/apiserver.crt, /tmp/apiserver.key) I0921 01:17:15.563960 1 requestheader_controller.go:169] Starting RequestHeaderAuthRequestController I0921 01:17:15.563987 1 shared_informer.go:240] Waiting for caches to sync for RequestHeaderAuthRequestController I0921 01:17:15.564009 1 configmap_cafile_content.go:201] "Starting controller" name="client-ca::kube-system::extension-apiserver-authentication::client-ca-file" I0921 01:17:15.564019 1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0921 01:17:15.564026 1 configmap_cafile_content.go:201] "Starting controller" name="client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file" I0921 01:17:15.564028 1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file I0921 01:17:15.564133 1 secure_serving.go:266] Serving securely on [::]:4443 I0921 01:17:15.564147 1 dynamic_serving_content.go:131] "Starting controller" name="serving-cert::/tmp/apiserver.crt::/tmp/apiserver.key" I0921 01:17:15.564258 1 tlsconfig.go:240] "Starting DynamicServingCertificateController" W0921 01:17:15.564313 1 shared_informer.go:372] The sharedIndexInformer has started, run more than once is not allowed I0921 01:17:15.664964 1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file I0921 01:17:15.665061 1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file I0921 01:17:15.665147 1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController I0921 01:17:44.418588 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0921 01:17:54.419197 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0921 01:18:04.428132 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0921 01:18:14.421964 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0921 01:18:24.420657 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve" I0921 01:18:34.430388 1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"

After executing ku top pods I get: error: Metrics not available for pod

josue-sanchez-wabtec avatar Sep 21 '22 01:09 josue-sanchez-wabtec

If you're using Docker Desktop, make sure you update it. It includes a fix that addresses this. After you update to the latest version, you have to reset your cluster and redeploy everything. Things work after that.

https://github.com/kubernetes-sigs/metrics-server/issues/1061#issuecomment-1208723497

marc-wilson avatar Sep 21 '22 01:09 marc-wilson