【问题标题】:How to find out node status last transition time using kubectl如何使用 kubectl 找出节点状态上次转换时间
【发布时间】:2019-12-02 18:28:40
【问题描述】:

我正在 Kubectl 中寻找一种方法来显示节点就绪/未就绪状态的历史记录以及转换时间的时间戳。

【问题讨论】:

    标签: kubernetes containers azure-aks


    【解决方案1】:

    节点状态的历史记录(准备好与否)和上次转换时间可以在 kubectl describe nodes 的输出中看到 Conditions: 部分:

    Name:          master-node-cf430c398
    ...
    Conditions:
    ...
      Type   Status  LastHeartbeatTime                 LastTransitionTime                Reason         Message
      ----   ------  -----------------                 ------------------                ------         -------
      Ready  True    Wed, 24 Jul 2019 16:14:06 +0000   Mon, 22 Jul 2019 20:17:19 +0000   KubeletReady   kubelet is posting ready status. AppArmor enabled
    ...
    
    
    Name:          worker-node-b587b0f0d3
    ...
    Conditions:
    ...
      Type   Status  LastHeartbeatTime                 LastTransitionTime                Reason         Message       
      ----   ------  -----------------                 ------------------                ------         -------       
      Ready  True    Wed, 24 Jul 2019 16:14:07 +0000   Mon, 22 Jul 2019 20:17:22 +0000   KubeletReady   kubelet is posting ready status. AppArmor enabled
    ...
    

    【讨论】:

    • 是否可以获得历史记录而不仅仅是最后的过渡时间?
    • 是的,我们可以在kubectl describe nodes的输出中看到不同状态和时间戳的历史记录。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-09
    • 1970-01-01
    相关资源
    最近更新 更多