如何使用kubectl找出节点状态的最后转换时间

时间:2019-07-24 14:48:03

标签: kubernetes containers azure-aks

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

1 个答案:

答案 0 :(得分:2)

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
...