Report this

What is the reason for this report?

kubectl top node|pod

Posted on November 9, 2018

It looks like heapster is not enabled on the cluster? Is this a planned feature?

kubectl top node
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)

I’ve used the same on other cloud providers (AKS, IKS) and it seems to be enabled…



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!

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.

The following will help with understanding what is happening on the nodes:

$ cat bin/node-resources.sh 
#!/bin/bash
set -euo pipefail

echo -e "Iterating...\n"

nodes=$(kubectl get node --no-headers -o custom-columns=NAME:.metadata.name)

for node in $nodes; do
  echo "Node: $node"
  kubectl describe node "$node" | sed '1,/Non-terminated Pods/d'
  echo
done

From https://github.com/kubernetes/kubernetes/issues/17512

You have to deploy heapster in your cluster to collect metrics ;) by default its not activated on digitalocean k8s-cluster.

There is a helm chart for heapster: https://github.com/helm/charts/tree/master/stable/heapster

  • Install metrics server chart

  • Update the command metrics server deployment and add the following two options to the pod command :

      - --kubelet-insecure-tls
      - --kubelet-preferred-address-types=InternalIP
    

Command will be look like this :

   command:
    - /metrics-server
    - --kubelet-insecure-tls
    - --kubelet-preferred-address-types=InternalIP

Wait two or three minutes, then the “top” command should work.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.