用于运行Pod和节点的Kubernetes Prometheus指标? [英] Kubernetes prometheus metrics for running pods and nodes?
问题描述
我已经通过遵循普罗米修斯文档.
I've set up prometheus to monitor kubernetes metrics by following the prometheus documentation.
许多有用的指标现在显示在Prometheus中.
A lot of useful metrics now show up in prometheus.
但是,我看不到任何引用我的Pod或节点状态的指标.
However, I can't see any metrics referencing the status of my pods or nodes.
理想情况-我希望能够绘制pod状态(运行,待处理,CrashLoopBackOff,错误)和节点(NodeReady,就绪)的图形.
Ideally - I'd like to be able to graph the pod status (Running, Pending, CrashLoopBackOff, Error) and nodes (NodeReady, Ready).
此指标在任何地方吗?如果没有,我可以在某个地方添加它吗?以及如何?
Is this metric anywhere? If not, can I add it somewhere? And how?
推荐答案
The regular kubernetes setup does not expose these metrics - further discussion here.
但是,可以使用另一项服务来收集这些集群级别的度量: https://github. com/kubernetes/kube-state-metrics .
However, another service can be used to collect these cluster level metrics: https://github.com/kubernetes/kube-state-metrics.
目前,这提供了听起来像我想要的那样的node_status_ready和pod_container_restarts.
This currently provides node_status_ready and pod_container_restarts which sound like what I want.
这篇关于用于运行Pod和节点的Kubernetes Prometheus指标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!