How to find out node status last transition time using kubectl

7/24/2019

I am looking for a way in Kubectl that shows the history of a node ready/notready status and the timestamp for the transition time.

-- mohatb
azure-aks
containers
kubernetes

1 Answer

7/24/2019

History of node status (ready or not) and last transition time can be seen in the output of kubectl describe nodes under the Conditions: section:

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
...
-- Vikram Hosakote
Source: StackOverflow