【问题标题】:What does _condition_ mean in metric?_condition_ 在公制中是什么意思?
【发布时间】:2018-11-28 21:47:02
【问题描述】:

kube-state-metrics 中,有一个 pod 度量标准 - kube_pod_status_ready 具有 3 个属性

pod=<pod-name>  
namespace=<pod-namespace> 
condition=<true|false|unknown>

condition 属性代表什么?我在文档中的任何地方都找不到它的定义。我可以猜到它的含义,但最好能得到它是如何计算的定义或解释。

【问题讨论】:

    标签: kubernetes kube-state-metrics


    【解决方案1】:

    这在API reference 中有记录。本质上,它是给定 pod 的 "type": "Ready"status 字段中的条件。例如在以下输出中:

    $ kubectl get pod <your-pod> -o=json | jq .status.conditions
    [
      ...
      {
        "lastProbeTime": null,
        "lastTransitionTime": "2018-11-20T22:45:27Z",
        "status": "True",
        "type": "Ready"
      },
      ...
    ]
    

    在这种情况下,子字段"status": "True" 代表您的指标中的condition=true。或者,"status": "False" 将代表 condition=false"status": "Unknown" 将代表 condition=unknown

    【讨论】:

      猜你喜欢
      • 2020-10-27
      • 2015-07-15
      • 2018-07-17
      • 2012-08-13
      • 2011-04-16
      • 1970-01-01
      • 1970-01-01
      • 2014-07-28
      • 2012-04-19
      相关资源
      最近更新 更多