Forum Topic

Thanks for your participation and contribution.

Back to Kubernetes

Resource Utilization

Post a reply

CPU Limits

$ kubectl get pods -n di-dev -o=jsonpath='{range .items[*]}{}{"\t"}{.spec.containers[0].resources.limits.cpu} {"\n"}{end}' |awk '{sum+=$2 ; print $0} END{print "sum=",sum}'

Memory Limits

$ kubectl get pods -n di-dev -o=jsonpath='{range .items[*]}{}{"\t"}{.spec.containers[0].resources.limits.memory} {"\n"}{end}' |awk '{sum+=$2 ; print $0} END{print "sum=",sum}'

CPU and Memory Requests and Limits

kubectl describe nodes | grep -A 2 -e "^\\s*CPU Requests"

LimitRange by Namespace

$ kubectl get limitrange --namespace namespace-example-1 --output=json

Describe Namespace

$ kubectl describe namespace namespace123

Status:  Active

No resource quota.

Resource Limits
 Type       Resource  Min  Max  Default Request  Default Limit  Max Limit/Request Ratio
 ----       --------  ---  ---  ---------------  -------------  -----------------------
 Container  cpu       -    -    100m             1500m          -
 Container  memory    -    -    100Mi            1000Mi         -

Last updated

1-1 of 1

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.