get_node_summaries
Retrieve a summary of Kubernetes cluster nodes, including status, roles, version, IPs, and capacity, similar to kubectl get nodes -o wide.
Instructions
Return a summary of the nodes for this Kubernetes cluster, similar to that
returned by kubectl get nodes -o wide.
Parameters
----------
None
This function does not take any parameters.
Returns
-------
list of NodeSummary
List of node summary objects. Each NodeSummary has the following fields:
name : str
Name of the node.
status : str
Status of the node (Ready, NotReady, etc.).
roles : list[str]
List of roles for the node (e.g., ['control-plane', 'master']).
age : datetime.timedelta
Age of the node (current time minus creation timestamp).
version : str
Kubernetes version running on the node.
internal_ip : Optional[str]
Internal IP address of the node.
external_ip : Optional[str]
External IP address of the node (if available).
os_image : Optional[str]
Operating system image running on the node.
kernel_version : Optional[str]
Kernel version of the node.
container_runtime : Optional[str]
Container runtime version on the node.
capacity : dict[str, str]
Total capacity of the node keyed by resource name (e.g. "cpu",
"memory", "ephemeral-storage", "pods"). Empty if unavailable.
allocatable : dict[str, str]
Resources allocatable to pods (capacity minus system-reserved),
keyed by resource name. Empty if unavailable.
conditions : dict[str, str]
Node conditions keyed by type with their status, e.g.
{"Ready": "True", "MemoryPressure": "False", "DiskPressure": "False"}.
conditions_since : dict[str, datetime.timedelta]
For each condition in `conditions`, the time since its status last
changed (the API's lastTransitionTime), e.g. how long the node has
been Ready, or how long ago a MemoryPressure episode ended. A
condition with no transition time is left out.
It changes only when the status does. A node or kubelet restart in
which the node comes back Ready without having been marked NotReady
or Unknown in between does not reset it: on a minikube cluster
stopped and started together with its control plane, Ready stayed
"True since the node was created" across a reboot. So a long Ready
age does not mean the node or its pods have been running that long,
and a short one can come from a brief NotReady flap rather than a
reboot. To date a node's last start, use its "Starting" or
"Rebooted" events (`get_events(involved_kind="Node")`, while they
last - events usually expire after an hour), or the `started_at` of
containers that start with the node, such as kube-proxy and the
kube-system control-plane containers (`get_pod_container_statuses`).
taints : list[str]
Taints on the node formatted as "key=value:effect" (value omitted
when empty).
labels : dict[str, str]
All labels on the node. Useful for identifying node pool / instance
type and spotting version skew across pools.
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to list nodes fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |