#!/bin/bash NAMESPACE="your-namespace-name" # Get a list of all pods in the specified namespace PODS=$(kubectl get pods -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}') # Loop through each pod and retrieve max CPU and memory usage for POD in $PODS; do MAX_CPU=$(kubectl describe pod $POD -n $NAMESPACE | grep "Limits" | grep "cpu" | awk '{print $2}') MAX_MEMORY=$(kubectl describe pod $POD -n $NAMESPACE | grep "Limits" | grep "memory" | awk '{print $2}') echo "Pod: $POD - Max Allocated CPU: $MAX_CPU, Max Allocated Memory: $MAX_MEMORY" done