Retrieves the spec for a given pod in a specific namespace.
Args:
pod_name (str): The name of the pod.
namespace (str): The namespace the pod belongs to (defaults to "default").
Returns
-------
dict[str, Any]
The pod's spec object, containing its desired state. It is converted
from a V1PodSpec to a dictionary. Key fields include:
containers : list of kubernetes.client.V1Container
List of containers belonging to the pod. Each container defines its image,
ports, environment variables, resource requests/limits, etc.
init_containers : list of kubernetes.client.V1Container, optional
List of initialization containers belonging to the pod.
volumes : list of kubernetes.client.V1Volume, optional
List of volumes mounted in the pod and the sources available for
the containers.
node_selector : dict, optional
A selector which must be true for the pod to fit on a node.
Keys and values are strings.
restart_policy : str
Restart policy for all containers within the pod.
Common values are "Always", "OnFailure", "Never".
service_account_name : str, optional
Service account name in the namespace that the pod will use to
access the Kubernetes API.
dns_policy : str
DNS policy for the pod. Common values are "ClusterFirst", "Default".
priority_class_name : str, optional
If specified, indicates the pod's priority_class via its name.
node_name : str, optional
NodeName is a request to schedule this pod onto a specific node.
Raises
------
K8SConfigError
If unable to initialize the K8S API
K8sApiError
If the pod is not found, configuration fails, or any other API error occurs.