How kubernetes calculate the acutal capacity of describe nodes?

When I run the kubectl describe nodes command
it shows me the output like

Capacity:
 cpu:                2
 ephemeral-storage:  102350Mi
 hugepages-2Mi:      0
 memory:             4266368Ki
 pods:               110

Some times it shows the storage and memory information in Ki and sometime in Mi
I want to know at what threshold value it will convert Ki to Mi and Gi automatically

I would be pleased if you share me the actual code of unit conversion on Github

1 Like