K8S关于pod资源监控

万事须己运,他得非我贤。这篇文章主要讲述K8S关于pod资源监控相关的知识,希望能为你提供帮助。

POD监控类型
指标
类型
说明
计算公式
cpu
container_cpu_usage_seconds_total
使用率
CPU使用率(CPU消费累计时间)
sum(rate(container_cpu_usage_seconds_totalimage!="",container!="POD",container!=""[1m])) by (pod,namespace) / (sum(container_spec_cpu_quotaimage!="",container!="POD",container!=""/100000) by (pod,namespace)) * 100
container_cpu_system_seconds_total
系统的态使用率
系统CPU消费的累计时间
sum(rate(container_cpu_system_seconds_totalimage!="",container!="POD",container!=""[1m])) by (pod,namespace) / (sum(container_spec_cpu_quotaimage!="",container!="POD",container!=""/100000) by (pod,namespace)) * 100
container_cpu_user_seconds_total
用户态使用率
用户CPU消费的累计时间
sum(rate(container_cpu_user_seconds_totalimage!="",container!="POD",container!=""[1m])) by (pod,namespace) / (sum(container_spec_cpu_quotaimage!="",container!="POD",container!=""/100000) by (pod,namespace)) * 100
container_cpu_cfs_throttled_seconds_total
limit
CPU限制的运行时间
sum(rate(container_cpu_cfs_throttled_seconds_total[5m])) by (container_name,pod,namespace)
内存
container_memory_rss
RSS%
常驻内存的百分比
sum(container_memory_rsscontainer!="POD",container!="alermanager",image!="",pod!="")by(pod) / sum(container_spec_memory_limit_bytescontainer!="",container!="POD")by(pod) * 100 != +inf
container_memory_working_set_bytes
请求率
当前使用内存的百分比
sum(container_memory_working_set_bytescontainer!="POD",container!="alermanager",image!="",pod!="")by(pod) / sum(container_spec_memory_limit_bytescontainer!="",container!="POD")by(pod) * 100 != +inf
container_memory_usage_bytes
内存使用
当前内存使用,包括所有缓存
sum(container_memory_usage_bytescontainer!="POD",container!="alermanager",image!="",pod!="")by (pod)
网络
container_network_receive_bytes_total
in(receive)
流量进来的
sum(irate(container_network_receive_bytes_total[1m])) by (pod,namespace)
container_network_transmit_bytes_total
out(transmit)
流量出去的
sum(irate(container_network_transmit_bytes_total namespace=~".+"[1m])) by (pod,namespace)
文件
container_fs_io_current
io-iops
当前正在进行的I/O数
sum(container_fs_io_current) by (namespace,pod_name)
container_fs_reads_bytes_total
io-read
read
sum(rate(container_fs_reads_bytes_total[5m])) by (container_name,pod,namespace)
container_fs_writes_bytes_total
io-write
write
sum(rate(container_fs_writes_bytes_total[5m])) by (container_name,pod,namespace)
container_fs_usage_byte
used%
磁盘使用率
sum(container_fs_usage_bytesimage!="",container!="POD",container!="") by(pod, namespace) / 1024 / 1024 / 1024
【K8S关于pod资源监控】


    推荐阅读