Re: [kubernetes/kubernetes] Complete help for kubectl top command when heapster is not in kube-system namespace (#44540)

10 views
Skip to first unread message

Michail Kargakis

unread,
May 21, 2017, 7:12:09 AM5/21/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@kubernetes/sig-cli-misc


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Shiyang Wang

unread,
May 22, 2017, 1:41:20 AM5/22/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

/assign

fejta-bot

unread,
Dec 24, 2017, 5:37:26 PM12/24/17
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

fejta-bot

unread,
Jan 23, 2018, 6:33:54 PM1/23/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.

/lifecycle rotten
/remove-lifecycle stale

Edward Vielmetti

unread,
Feb 4, 2018, 12:22:20 AM2/4/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I think this can be closed, since kubectl top node --help provides the requested information.

k8s-ci-robot

unread,
Mar 6, 2018, 12:56:39 AM3/6/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Closed #44540.

fejta-bot

unread,
Mar 6, 2018, 12:56:41 AM3/6/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.


Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

so0k

unread,
May 20, 2018, 4:54:05 PM5/20/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

in my case it was version mismatch between kubectl client and api server (I had a newer client)

using the correct version of the client solved the error mentioned (for those who got here after searching google for the error message)

Abu Shoeb

unread,
Jun 5, 2018, 11:41:35 AM6/5/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Hey, I'm using k8 1.7 and running hepaster. When I run $ kubectl top nodes --heapster-namespace=kube-system, it shows me "error: metrics not available yet". Any clue for tackling the error?

Abu Shoeb

unread,
Jun 5, 2018, 2:10:09 PM6/5/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@xmik thanks for the help. Is there a way to get GPU usage information?

lenhattan86

unread,
Aug 13, 2018, 4:28:59 PM8/13/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I got the same issue with Kubernetes 1.11 & latest Heapster.

$kubectl top pod --namespace=kube-system
W0813 13:48:08.426536 27831 top_pod.go:263] Metrics not available for pod kube-system/calico-node-8d5d4, age: 38m1.426522624s
error: Metrics not available for pod kube-system/calico-node-8d5d4, age: 38m1.426522624s

Zwordi

unread,
Aug 29, 2018, 7:39:12 AM8/29/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Hi,
I have the same behavior even if heapster is on the kube-system namespaces.
What i don't understand it's why even if it's an deprecated project replace by metrics-server do we still need to find an heapster service on the cluster...

Regards,

Grant Doctor

unread,
Sep 25, 2018, 4:47:07 PM9/25/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Any update from anyone in the metrics-server community? Heapster is deprecated as mentioned above, yet the metrics-server commands are still asking for a heapster server. @DirectXMan12 @piosz

Steven Robertson

unread,
Sep 25, 2018, 5:32:19 PM9/25/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

When error: metrics not available yet happened to me it ended up being an error with the metrics deployment itself. I did a kubectl get pods -n kube-system, found the metrics pod and a kubectl describe pod... helped me diagnose why the deployment wouldn't work.

I had to patch this default metrics-server deployment:
https://raw.githubusercontent.com/kubernetes/kops/master/addons/metrics-server/v1.8.x.yaml
with these changes:

containers:
        - name: metrics-server
          image: gcr.io/google_containers/metrics-server-amd64:v0.3.0
          imagePullPolicy: Always
          command:
            - /metrics-server
            - --kubelet-preferred-address-types=InternalIP
            # - --source=kubernetes.summary_api:''

And that got things working for me.

Solly Ross

unread,
Sep 27, 2018, 3:44:54 PM9/27/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@gdoctor these days, the only reason it should ask about Heapster is if the resource metrics API isn't available. The kubectl top logic prefers using the resource metrics API, but will fall back to Heapster if it isn't present (to give people time to upgrade clusters and clients), which means if neither are working, you'll see an error about Heapster.

@s1113950 that kops manifest appears to be out of date/not actually tests. v0.3.0 changed how the options are specified, so it makes sense that you needed to make that change. Please file an issue with the kops repository.

shaikkhaja5628

unread,
Oct 15, 2018, 6:35:12 AM10/15/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Hi All
I am facing the same issue on with kubectl top pod command with above 1.10 version also
root@:/home# kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}

Getting the below error:
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)

can anyone help me out this

Arm4x

unread,
Oct 17, 2018, 5:57:40 AM10/17/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Hi All
I am facing the same issue on with kubectl top pod command with above 1.10 version also
root@:/home# kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"linux/amd64"}

Getting the below error:
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)

can anyone help me out this

Same problem here, using kubernetes 1.11 on digitalocean

Manuel José Pinot Paz

unread,
Nov 7, 2018, 1:19:02 PM11/7/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Same problem using kubernetes v1.12.2

Solly Ross

unread,
Nov 7, 2018, 3:31:34 PM11/7/18
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

please make sure you've deployed metrics-server and have the metrics.k8s.io API correctly registered (check kubectl get apiservices)

prageethw

unread,
Jan 25, 2019, 10:26:37 PM1/25/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I can confirm this starts to appear again in kops 1.11.0 even with

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

for metrics server command line.
it seems above works in kops 1.10.0
tested in k8s versions below and works well in kops 1.10.0 but not when with kops 1.11.0

1.10.12
1.11.1
1.11.3
1.11.5
1.11.7

jorge-fans

unread,
May 9, 2019, 11:22:34 AM5/9/19
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I know this --kubelet-insecure-tls will make it work. but is important to note that this is useful in test clusters with self-signed Kubelet serving certificates but is not recommended for production usage

kainwei

unread,
Jun 15, 2020, 12:52:47 AM6/15/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

For me, the problem is I didn't install the metric server and installing metric server is worked for me:

$ git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git
$ kubectl create -f kubernetes-metrics-server/

reference from : https://stackoverflow.com/questions/52860209/kubernetes-1-11-could-not-find-heapster-for-metrics

hope it can helps.


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

bbhupati

unread,
Jun 24, 2020, 1:09:05 AM6/24/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Thanks lot Kaniwei, its worked for me

diegoxro

unread,
Aug 19, 2020, 12:04:48 PM8/19/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

For me, the problem is I didn't install the metric server and installing metric server is worked for me:

$ git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git
$ kubectl create -f kubernetes-metrics-server/

reference from : https://stackoverflow.com/questions/52860209/kubernetes-1-11-could-not-find-heapster-for-metrics

hope it can helps.

this was the only solution for me thanks

Alexsandro Souza Pereira

unread,
Sep 30, 2020, 10:01:30 PM9/30/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

I have same issue in Digital Ocean.

Jayesh Jose

unread,
Oct 19, 2020, 5:35:42 PM10/19/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

@alexsandro-xpt have you tried installing metric server as suggested by @kainwei , It worked for me

jerryzhyliu

unread,
Dec 22, 2020, 6:56:41 AM12/22/20
to kubernetes/kubernetes, k8s-mirror-cli-misc, Team mention

Still have the issue...

kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.8", GitCommit:"9f2892aab98fe339f3bd70e3c470144299398ace", GitTreeState:"clean", BuildDate:"2020-08-13T16:12:48Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}

[root@k8smaster ~]# kubectl create -f kubernetes-metrics-server/
clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
serviceaccount/metrics-server created
deployment.apps/metrics-server created
service/metrics-server created
clusterrole.rbac.authorization.k8s.io/system:metrics-server created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
[root@k8smaster ~]# kubectl top nodes
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
[root@k8smaster ~]# kubectl top pods
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get pods.metrics.k8s.io)

Reply all
Reply to author
Forward
0 new messages