get_pod_summaries
Retrieve summarized details of Kubernetes pods, including status, container readiness, restarts, and node information, for a specific or all namespaces.
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 the container last restart (None if never restarted).
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).
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 |
Input Schema (JSON Schema)
{
"properties": {
"namespace": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Namespace"
}
},
"title": "get_pod_summariesArguments",
"type": "object"
}