check eks resources (fish function)

From wikieduonline
Revision as of 07:55, 28 May 2026 by Welcome (talk | contribs) (Welcome moved page Check eks resources to Check eks resources (fish function))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Fish

function check_eks_resources --description 'List EKS clusters, nodegroups, and allocated resources'
    for cluster in (aws eks list-clusters --query "clusters" --output text)
        echo "========================================================================"
        echo " 🚀 CLUSTER: $cluster"
        echo "========================================================================"
        
        set nodegroups (aws eks list-nodegroups --cluster-name $cluster --query "nodegroups" --output text)
        
        if test -z "$nodegroups"
            echo "No nodegroups found for this cluster."
        else
            for ng in $nodegroups
                echo "👉 Node Group: $ng"
                aws eks describe-nodegroup --cluster-name $cluster --nodegroup-name $ng \
                    --query 'nodegroup.{"1.Instance Types": instanceTypes[0], "2.Capacity Type": capacityType, "3.Disk Size (GB)": diskSize, "4.Desired Nodes": scalingConfig.desiredSize, "5.Min Nodes": scalingConfig.minSize, "6.Max Nodes": scalingConfig.maxSize}' --output table
                echo ""
            end
        end
    end
end

# Save it permanently
funcsave check_eks_resources


EKS Nodegroup, Managed Node Groups (MNG), eksctl upgrade nodegroup, aws eks [ list-nodegroups | describe-nodegroup | update-nodegroup-version | create nodegroup ], check eks resources (fish function)

Advertising: