Is kubectl top the current memory / CPU value or is it an average of a certain time period ?
It's the actual usage of the pods and nodes at the moment you issue the command.
Example:
$ kubectl top nodes
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
ip-xxx-xx-x-xxx.us-west-2.compute.internal 62m 6% 1014Mi 27%
Using 62 milicores(0.062 cores), 6% of the CPUs, 1014 Mebybites and 24% of the memory at the moment the API returned.
You can also find more information here.
"kubectl top node" doesn't provide the real-time of nodes's CPU usage. It will have around 5-20 seconds delay. You could check the output of <date; kubectl top nodes; kubectl get --raw "/apis/metrics.k8s.io/v1beta1/nodes"|jq>.
According to the output, you will find those statastics collected from the interval [Timestamp-Window, Timestamp].
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With