Kubectl status nodes provides different responses for equivalent clusters
To display used and total resources you can use kubectl top
Display Resource (CPU/Memory/Storage) usage.
The top command allows you to see the resource consumption for nodes or pods.
This command requires Metrics Server to be correctly configured and working on the server.
Available Commands:node Display Resource (CPU/Memory/Storage) usage of nodespod Display Resource (CPU/Memory/Storage) usage of pods
Usage:kubectl top [flags] [options]
You can also have a look at Tools for Monitoring Resources inside Kubernetes docs.
As for doing the same using Kubernetes Python Client you can use:
from kubernetes.config import load_kube_config from kubernetes.client import CustomObjectsApi load_kube_config() cust = CustomObjectsApi() cust.list_cluster_custom_object('metrics.k8s.io', 'v1beta1', 'nodes') # All node metricscust.list_cluster_custom_object('metrics.k8s.io', 'v1beta1', 'pods') # All Pod Metrics