Not a customer? Click the 'Start a free trial' link to begin a 30-day SaaS trial of our product and to join our community.
Existing Cisco AppDynamics customers should click the 'Sign In' button to authenticate to access the community
on 04-29-2024 10:52 AM - edited on 05-07-2024 09:18 AM by Ryan.Paredez
In the image below we see Cluster Capacity is being met.
kubectl get nodes -o jsonpath='{.items[*].status.capacity.pods}' | tr -s ' ' '\n' | a
First, you need to determine the maximum number of pods that each node can support. This can typically be found in the node’s capacity information:
kubectl get nodes -o jsonpath='{.items[*].status.capacity.pods}'
This command will print the maximum number of pods for each node in your cluster.
Next, count the total number of nodes in your cluster:
kubectl get nodes --no-headers | wc -l
You can then multiply the average (or minimum if there is a large disparity) maximum pods per node by the total number of nodes to get an estimate of the total pod capacity of the cluster.
If you want a single command to fetch the total pod capacity based on the current node configurations and assuming uniform configuration across nodes, you could use the following command chain:
kubectl get nodes -o jsonpath='{.items[*].status.capacity.pods}' | tr -s ' ' '\n' | a
In this case,
abhibaj@ABHIBAJ-M-2KXL KubernetesInstallation % kubectl get nodes -o jsonpath='{.items[*].status.capacity.pods}' | tr -s ' ' '\n' | awk '{sum += $1} END {print sum}'
116
The same can be seen on the ClusterAgent page.
Thank you! Your submission has been received!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form