I deployed the metrics-server in my minikube and has the deployment, pod, service, clusterrole, rolebindings and clusterrolebindings configured and running properly.
But when I say
kubectl top node
i am getting the below error.
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
Why do I need heapster, isn't metrics-server supposed to be a successor of heapster ?
My Minikube Environment:
minikube version:
v0.24.1
kubectl version :
Client - 1.8
Server - 1.8
kubectl api-versions
admissionregistration.k8s.io/v1alpha1
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
apps/v1beta1
apps/v1beta2
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
batch/v1
batch/v1beta1
batch/v2alpha1
certificates.k8s.io/v1beta1
extensions/v1beta1
metrics.k8s.io/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1alpha1
rbac.authorization.k8s.io/v1beta1
settings.k8s.io/v1alpha1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1
I have met the same problem, If you want to use kubectl top , you will need heapster, Here's the same question, Duplicate of #34
closing as a duplicate. If you want to use kubectl top in anything less that 1.10, you'll need Heapster.
@DirectXMan12 BUT:
Starting from Kubernetes 1.8, resource usage metrics, such as container CPU and memory usage, are available in Kubernetes through the Metrics API. These metrics can be either accessed directly by user, for example by using kubectl top command, or used by a controller in the cluster, e.g. Horizontal Pod Autoscaler, to make decisions
from: https://kubernetes.io/docs/tasks/debug-application-cluster/core-metrics-pipeline/
so I understand that it should be available from 1.8 onwards as kubectl is using the MetricsAPI which is served via the metrics-server. Or did i get something wrong here?
that passage is not quite correct. Unfortunately, kubectl top lagged behind the other components which consumed metrics, and didn't get the update until 1.10, and there was a disconnect between what happened there and the docs that were written. We need to file a bug against the website to correct that doc.
@DirectXMan12 ok, thanks! So i now run Heapster and that works nicely with 1.9.x. As soon as 1.10 is rolled out, kubectl should be working against metrics-server then?
yep!
kubectl top pod cpu-demo --namespace=cpu-example
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
why ?
@NEWgaofeng Please ensure that you have metrics server deployed and read comments above about why kubectl mentions heapster.
Hi @serathius ,
Heapster mentioned as retired and suggesting to use metrics-server. metrics-server document shows kubectl top not implemented. Any other way to get it work.
Kubectl works with metrics-server for long time, documentation is out of date.
Created issue https://github.com/kubernetes/kubectl/issues/806
Most helpful comment
closing as a duplicate. If you want to use
kubectl topin anything less that 1.10, you'll need Heapster.