Question

How to run metrics-server in managed k8s?

I spent about 3 days with this issue :(

  1. I tried to install metrcis-server(https://github.com/kubernetes-sigs/metrics-server) on my own cluster. Of course I tried to turn on the option of prefer-internalIP option, which mentioned in the article(https://www.digitalocean.com/community/tutorials/how-to-autoscale-your-workloads-on-digitalocean-kubernetes#step-3-—-installing-metrics-server)
  2. (Because 1 failed) I tried to install metrics-server through marketplace one(https://cloud.digitalocean.com/marketplace/5d83d4f9cc248c518b58a38c?i=654b99)
  3. Now I’m writing this…

No matter what I try to install metrics-server on my cluster, I can’t see CPU/memory usage of my pods. CPU/memory usage of my nodes is fine, but pods.

metric-server log says follwing (for every deployed pods)

1 reststorage.go:160] unable to fetch pod metrics for pod, ...: no metrics known for pod

My cluster runs

kubectl top nodes shows

NAME                   CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
pool-mypoolinfoblahb   130m         6%     1323Mi          42%
pool-mypoolinfoblahb   79m          3%     806Mi           25%

kubectl top pods shows

W1103 16:56:02.901596   25473 top_pod.go:265] Metrics not available for pod default/my-pod-info-blahblah, age: 8m1.901588s
error: Metrics not available for pod default/my-pod-info-blahblah, age: 8m1.901588s

Somebody please help me

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

to whom it may concern, DO team would release new DO version to resolve the issue (yay!)

link: https://github.com/digitalocean/DOKS/issues/2#issuecomment-721544306

I apologize for bumping the topic, but the information mentioned by Chris Lenard is slightly out-of-date for the newer versions of the Bitnami metrics-server chart.

We deployed the chart using these values:

apiService:
  create: true
extraArgs:
- --kubelet-preferred-address-types=InternalIP
service:
  nodePorts:
    https: 8443

The divergent https port is required, because out-of-the-box DigitalOcean does not (or not any longer, perhaps) allow binding on privileged ports for containers.

Full command used:

helm -n <your-namespace> install metrics-server bitnami/metrics-server --atomic --set 'extraArgs[0]=--kubelet-preferred-address-types=InternalIP' --set apiService.create=true --set service.nodePorts.https=8443

Chart: https://github.com/bitnami/charts/tree/main/bitnami/metrics-server

I ran into a similar issue on DOKS 1.20.2. I was deploying using the bitnami metrics server helm chart. I had to set the command arg kubelet-preferred-address-types=InternalIP and apiService.create=true because the api-service isn’t created already by DO.

For reference: https://github.com/bitnami/charts/tree/master/bitnami/metrics-server#parameters

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel