博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
metrics-server最新版本有坑,慎用
阅读量:5969 次
发布时间:2019-06-19

本文共 2495 字,大约阅读时间需要 8 分钟。

参考文档:https://www.jianshu.com/p/262177fa9320

版本:metrics-server-amd64:v0.3.3

          addon-resizer:1.8.4

[root@master metrics]# vim metrics-server-deployment.yaml 

查看:

莫名其妙的一对报错,不错最终搞好了。

毫无里头报错:

[root@master ~]# kubectl logs metrics-server-v0.3.3-856bb6d5f8-55dbc -c  metrics-server -n kube-system 

aster: unable to fetch metrics from Kubelet master (192.168.19.134): Get https://192.168.19.134:10255/stats/summary/: dial tcp 192.168.19.134:10255: connect: connection refused, unable to fully scrape metrics from source kubelet_summary:node1: unable to fetch metrics from Kubelet node1 (192.168.19.133): Get https://192.168.19.133:10255/stats/summary/: dial tcp 192.168.19.133:10255: connect: connection refused, unable to fully scrape metrics from source kubelet_summary:node2: unable to fetch metrics from Kubelet node2 (192.168.19.135): Get https://192.168.19.135:10255/stats/summary/: dial tcp 192.168.19.135:10255: connect: connection refused]

[root@master ~]# kubectl logs metrics-server-v0.3.3-6448dcfb78-rrhd8 -c metrics-server-nanny -n kube-system

ERROR: logging before flag.Parse: I0528 06:16:58.415375       1 pod_nanny.go:138] Resources: [{Base:{i:{value:80 scale:-3} d:{Dec:<nil>} s:80m Format:DecimalSI} ExtraPerNode:{i:{value:5 scale:-4} d:{Dec:<nil>} s: Format:DecimalSI} Name:cpu} {Base:{i:{value:83886080 scale:0} d:{Dec:<nil>} s: Format:BinarySI} ExtraPerNode:{i:{value:8388608 scale:0} d:{Dec:<nil>} s: Format:BinarySI} Name:memory}]

 需要修改的配置

[root@master metrics]# vim metrics-server-deployment.yaml

[root@master metrics]# vim resource-reader.yaml    增加  - nodes/stats

 

 

测试正常显示:

[root@master yaml]# kubectl proxy --port=8080

[root@master ~]# kubectl top nodes

NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
master 115m 5% 1186Mi 68%
node1 18m 1% 265Mi 30%
node2 34m 1% 502Mi 29%
[root@master ~]# kubectl top pods
NAME CPU(cores) MEMORY(bytes)
default-http-backend-7784d46bf4-m62x5 1m 4Mi
httpd-5d8cbbcd67-8pqnt 1m 12Mi
myapp-deploy-677bbbb679-n2vhw 0m 2Mi
myapp-deploy-677bbbb679-zjb5n 0m 2Mi
pod-vol-hostpath 0m 2Mi
redis-85b846ff9c-bsln6 1m 8Mi
[root@master ~]# curl http://localhost:8080/apis/metrics.k8s.io/v1beta1/nodes
{
"kind": "NodeMetricsList",
"apiVersion": "metrics.k8s.io/v1beta1",
"metadata": {
"selfLink": "/apis/metrics.k8s.io/v1beta1/nodes"
},
"items": [
{
"metadata": {
"name": "master",
"selfLink": "/apis/metrics.k8s.io/v1beta1/nodes/master",
"creationTimestamp": "2019-05-28T06:34:06Z"
},
"timestamp": "2019-05-28T06:33:14Z",

 

转载于:https://www.cnblogs.com/sunnyyangwang/p/10937238.html

你可能感兴趣的文章
C++ 构造函数与析构函数
查看>>
Python快速教程
查看>>
ssh免密码登录
查看>>
Linux下Django环境安装
查看>>
如何在指定的内容中找出指定字符串的个数
查看>>
我的友情链接
查看>>
浅谈如何用We7站群平台打造垂直性政务网站
查看>>
我的友情链接
查看>>
Go bytes包
查看>>
Spring MVC请求处理流程分析
查看>>
生产环境MySQL 5.5.x单机多实例配置实践
查看>>
Web应用工作原理、动态网页技术
查看>>
EXCEL工作表保护密码破解 宏撤销保护图文教程
查看>>
Catalan数(卡特兰数)
查看>>
.Net Core下使用 RSA
查看>>
python 数据库中文乱码 Excel
查看>>
利用console控制台调试php代码
查看>>
递归算法,如何把list中父子类对象递归成树
查看>>
jsf初学解决GlassFish Server 无法启动
查看>>
hdu 1050 (preinitilization or postcleansing, std::fill) ...
查看>>