[root]# kubectl top node
Error from server (NotFound): the server could not find the requested resource (get services http:heapster:)
解决办法:
git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git
kubectl create -f kubernetes-metrics-server/
解决后:
[root@openc3-srv-docker kubernetes-metrics-server]# kubectl top node
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
localhost.localdomain 83m 2% 2081Mi 26%
[root@openc3-srv-docker kubernetes-metrics-server]# kubectl top pod -A
NAMESPACE NAME CPU(cores) MEMORY(bytes)
fengtest nginx-6b565b9848-cswp5 0m 5Mi
fengtest nginx-6b565b9848-mhbd5 0m 5Mi
kube-system coredns-7ff77c879f-lvgkr 2m 14Mi
kube-system coredns-7ff77c879f-ng4th 2m 14Mi
kube-system etcd-localhost.localdomain 11m 368Mi
kube-system kube-apiserver-localhost.localdomain 20m 311Mi
kube-system kube-controller-manager-localhost.localdomain 7m 47Mi
kube-system kube-flannel-ds-amd64-n4lx6 2m 16Mi
kube-system kube-proxy-bvh5j 1m 18Mi
kube-system kube-scheduler-localhost.localdomain 2m 21Mi
kube-system metrics-server-5b7698966-5x9xp 1m 16Mi
kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-s8l4s 1m 12Mi
kubernetes-dashboard kubernetes-dashboard-5d8f5b7db6-7sdzd 1m 20Mi