Created
May 22, 2018 11:30
-
-
Save harryge00/2d61a03b565c6bfbe544ec7a868d4546 to your computer and use it in GitHub Desktop.
Calculate the total CPU limit of the first containers in a namespace of Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl get pods -n chenkunning-84 -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[0].resources.limits.cpu} {"\n"}{end}' |awk '{sum+=$2 ; print $0} END{print "sum=",sum}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment