can anyone help me with the command to view limits and requests of a pod or containers in a pod? I have tried
Kubectl describe pod ,
kubectl get pod --output=yaml ,
kubectl describe node - shows the current limits but not the configured limits. I want to see the configured limits and requests in the yaml.
Thanks.
-Try following command :
kubectl get pods <podname> -o jsonpath='{range .spec.containers[*]}{"Container Name: "}{.name}{"\n"}{"Requests:"}{.resources.requests}{"\n"}{"Limits:"}{.resources.limits}{"\n"}{end}'
Example:
kubectl get pods frontend -o jsonpath='{range .spec.containers[*]}{"Container Name: "}{.name}{"\n"}{"Requests:"}{.resources.requests}{"\n"}{"Limits:"}{.resources.limits}{"\n"}{end}'
Container Name: app
Requests:{"cpu":"250m","memory":"64Mi"}
Limits:{"cpu":"500m","memory":"128Mi"}
Container Name: log-aggregator
Requests:{"cpu":"250m","memory":"64Mi"}
Limits:{"cpu":"500m","memory":"128Mi"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With