get_pod_container_statuses
Retrieve the status of all containers in a specified Kubernetes pod, including readiness, restart count, state, and resources. Use it to diagnose container health issues.
Instructions
Get the status for all containers in a specified Kubernetes pod.
Parameters
----------
pod_name : str
Name of the pod to retrieve container statuses for.
namespace : str, optional
Namespace of the pod (default is "default").
Returns
-------
list of ContainerStatus
List of container status objects for the specified pod. Each ContainerStatus has the following fields:
pod_name : str
Name of the pod.
namespace : str
Namespace of the pod.
container_name : str
Name of the container.
image : str
Image name.
ready : bool
Whether the container is currently passing its readiness check.
The value will change as readiness probes keep executing.
restart_count : int
Number of times the container has restarted.
started : Optional[bool]
Started indicates whether the container has finished its postStart
lifecycle hook and passed its startup probe.
stop_signal : Optional[str]
Stop signal for the container.
state : Optional[ContainerState]
Current state of the container.
last_state : Optional[ContainerState]
Last state of the container. When Terminated, ``ran_for`` is how long
that instance ran (``finished_at - started_at``). It is not the
restart interval, which adds the back-off named in a Waiting
``state``'s message, and it is not how much time the container's log
covers: a process can stop logging long before it is killed.
volume_mounts : list[VolumeMountStatus]
Status of volume mounts for the container
resource_requests : dict[str, str]
Describes the minimum amount of compute resources required. If Requests
is omitted for a container, it defaults to Limits if that is explicitly specified,
otherwise to an implementation-defined value. Requests cannot exceed Limits.
resource_limits : dict[str, str]
Describes the maximum amount of compute resources allowed.
allocated_resources : dict[str, str]
Compute resources allocated for this container by the node.
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to read the pod fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pod_name | Yes | ||
| namespace | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |