Skip to main content

DemystifyFailedOrPendingPod

inspects the pod status of a failed or pending pod and attempts to determine the reason for the failure or pending state. This function currently only handles pods in the Failed or Pending phase. This is useful to check the specific error from the pod in the rayjob, sparkjob, etc. For example, if the pod is in the Failed phase due to an image pull error, this function can return a more specific error message indicating that the image could not be pulled. Similarly, if the pod is in the Pending phase due to insufficient resources, this function can return an error message indicating that the pod could not be scheduled due to lack of resources.

def DemystifyFailedOrPendingPod(
ctx: context.Context,
pluginContext: k8s.PluginContext,
info: pluginsCore.TaskInfo,
namespace: string,
podName: string,
primaryContainerName: string
) - > pluginsCore.PhaseInfo, error

Inspects the pod status of a failed or pending pod and attempts to determine the reason for the failure or pending state. This function currently only handles pods in the Failed or Pending phase. This is useful to check the specific error from the pod in the rayjob, sparkjob, etc.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and deadlines.
pluginContextk8s.PluginContextThe Kubernetes plugin context, providing access to the Kubernetes client for reading resources.
infopluginsCore.TaskInfoInformation about the task associated with the pod.
namespacestringThe namespace of the pod to inspect.
podNamestringThe name of the pod to inspect.
primaryContainerNamestringThe name of the primary container within the pod, used for demystifying failures.

Returns

TypeDescription
pluginsCore.PhaseInfo, errorA PhaseInfo object containing the demystified status and an error if one occurred during the process.