get_pod_summaries
Retrieve pod summaries for a namespace or across all namespaces, showing status, readiness, restarts, age, IP, node, and owner to diagnose workloads.
Instructions
Retrieves a list of PodSummary objects for pods in a given namespace or all namespaces.
Parameters
----------
namespace : Optional[str], default=None
The specific namespace to list pods from. If None, lists pods from all namespaces.
Returns
-------
list of PodSummary
A list of PodSummary objects, each providing a summary of a pod's status with the following fields:
name : str
Name of the pod.
namespace : str
Namespace in which the pod is running.
total_containers : int
Total number of containers in the pod.
ready_containers : int
Number of containers currently in ready state.
restarts : int
Total number of restarts for all containers in the pod.
last_restart : Optional[datetime.timedelta]
Time since a container of this pod last terminated - the most
recent last_state.finished_at across its containers - or None if
none has. For a container waiting in CrashLoopBackOff this is its
last crash, not a restart: it has not been started again yet. Taken
from the kubelet's status, so it is current, unlike event records.
age : datetime.timedelta
Age of the pod (current time minus creation timestamp).
ip : Optional[str]
Pod IP address (None if not assigned).
node : Optional[str]
Name of the node where the pod is running (None if not scheduled).
owner : Optional[str]
The pod's controlling owner, as "Kind/name" - the object that
created and manages it, e.g. "DaemonSet/otel-collector-agent",
"StatefulSet/valkey-cart", "Job/backup-29318400". None for a bare
pod nobody manages. This is the direct owner only: a Deployment's
pods are owned by one of its replica sets ("ReplicaSet/ad-7d9f8c6b5"),
whose `owner_deployment` (`get_replicaset_summaries`) names the
Deployment; likewise a Job's `owner` names its CronJob. Static
(mirror) pods such as the control plane's report "Node/<node name>".
Group pods into workloads by this field rather than by stripping
name suffixes.
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to list pods fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |