I’m trying to customize the output of the command kubectl get hpa
with the -o
flag. If I run
kubectl get hpa -o=custom-columns='MEMORY:.status.currentMetrics[1].resource.current.averageValue'
I get
MEMORY
22466478
which is the current memory utilization in bytes and not very human readable. I’d like to convert it to megabytes within the command output, so that I get something like
MEMORY
22.47MB
Is it possible to do this within the kubectl
commnad (i.e. without some kind of wrapper)?
(note: there will be more columns than this in the final output. I’ve presented a minimal version for simplicity’s sake)