Documentation
¶
Overview ¶
Package podutil provides pod discovery and status helpers for Kubernetes workloads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerRestartStatus ¶
ContainerRestartStatus returns the restart count and whether the named container is in a waiting state (e.g., CrashLoopBackOff).
func GetContainerTerminationTime ¶
GetContainerTerminationTime returns when a container terminated. Returns nil if the container has not terminated or is not found.
func IsPodRunning ¶
IsPodRunning checks if a pod is in the Running phase.
Types ¶
type WorkerDiscoverer ¶
type WorkerDiscoverer struct {
// contains filtered or unexported fields
}
WorkerDiscoverer finds worker pods for training workloads.
func NewWorkerDiscoverer ¶
func NewWorkerDiscoverer(c client.Reader) *WorkerDiscoverer
NewWorkerDiscoverer creates a new WorkerDiscoverer.
func (*WorkerDiscoverer) GetReplicatedJobPod ¶
func (d *WorkerDiscoverer) GetReplicatedJobPod(ctx context.Context, namespace, workloadName, replicatedJobName string) (*corev1.Pod, error)
GetReplicatedJobPod finds the first running pod for a specific replicatedJob within a TrainJob's JobSet. replicatedJobName is "launcher" for MPI workloads or "node" for torch workloads.
func (*WorkerDiscoverer) GetWorkerPods ¶
func (d *WorkerDiscoverer) GetWorkerPods(ctx context.Context, namespace, name, workloadKind string) (worker0 *corev1.Pod, lastWorker *corev1.Pod, err error)
GetWorkerPods returns the worker-0 and optionally the last worker pod. workloadKind is one of: "TrainJob". The lastWorker may be nil if the workload is single-worker or replica count is 1.