kubernetesmetricskubernetes-podkubernetes-metrics

Different unit for Kubernetes resource memory on pods


My question is related to Kubernetes and the units of the metrics used for the HPA (autoscaling).

When I run the command

kubectl describe hpa my-autoscaler

I get (a part of more information) this:

...
Metrics:                                               ( current / target )
  resource memory on pods:                             318067507200m / 1000Mi
  resource cpu on pods  (as a percentage of request):  1% (1m) / 80%
...

In this example, when you can see the metrics for the resource memory on pods, you can see that the unit for the current value is m, which is "millis" (as is described in the official documentation), but the unit used for the target value is Mi, which is "Mebis"

Is there any problem with the usage of different units?

Thanks!


Solution

  • No, they are just different multipliers. The actual code is using a raw number of bytes under the hood.