I deployed the metrics-server following the guide here.
I didn't enable the heapster from addons list.
The metrics-server was deployed successfully in minikube. But when I run the below command
kubectl top pod
or
kubectl top node
this results in the following error.
Error from server (NotFound): the server could not find the requested resource (get services >http:heapster:)
My local machine configurations:
Minikube Version (minikube version): v0.24.1
Kubernetes Version (kubectl version): 1.8
kubectl top only recently (within the past couple of days) switched to using metrics server, so it's not available in Kubernetes 1.8. Furthermore, this isn't a metrics-server question.
I'm seeing the same thing as of 1.10:
kumo [master !?] -> kubectl create -f metrics-server/deploy/1.8+/
clusterrolebinding "metrics-server:system:auth-delegator" created
rolebinding "metrics-server-auth-reader" created
apiservice "v1beta1.metrics.k8s.io" created
serviceaccount "metrics-server" created
deployment "metrics-server" created
service "metrics-server" created
clusterrole "system:metrics-server" created
clusterrolebinding "system:metrics-server" created
kumo [master !?] -> kubectl top node
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
kumo [master !?] -> kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.7", GitCommit:"dd5e1a2978fd0b97d9b78e1564398aeea7e7fe92", GitTreeState:"clean", BuildDate:"2018-04-19T00:05:56Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
kumo [master !?] -> minikube version
minikube version: v0.29.0
You still have a 1.9 kubectl. Fix that, and your problem should go away.
@DirectXMan12 Ah, I see.
Hi All
I am also 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:)
Hi All
I am also 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:)
I am facing the issue using v1.10.2 would be nice if the fix fixed it, but apparently it does not.
make sure you've got a registered metrics.k8s.io API. You should only see that error message if kubectl top tries to fall back to Heapster if it can't find the metrics API.
@DirectXMan12 How do you do that exactly? I've enabled heapster addon, recreated the VM, see the heapster pod running in kube-system, but I get the error above when inspecting a pod in a different namespace
Most helpful comment
make sure you've got a registered metrics.k8s.io API. You should only see that error message if
kubectl toptries to fall back to Heapster if it can't find the metrics API.