Skip to content

Commit

Permalink
Improve logs based on pod conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
oksanabaza committed Aug 30, 2024
1 parent 3fbce0f commit 9f67eae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ray-operator/controllers/ray/raycluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,21 @@ func (r *RayClusterReconciler) reconcilePods(ctx context.Context, instance *rayv
deleted := struct{}{}
numDeletedUnhealthyWorkerPods := 0
for _, workerPod := range workerPods.Items {
logger.Info("reconcilePods", "Worker Pod Name: ", workerPod.Name, " Status: ", workerPod.Status.Phase)
if workerPod.Status.Phase != "Running" {
if len(workerPod.Status.Conditions) > 0 {
for _, condition := range workerPod.Status.Conditions {
if condition.Message != "" {
logger.Info("reconcilePods",
"Worker Pod Name", workerPod.Name,
"Status", workerPod.Status.Phase,
"Condition Type", condition.Type,
"Condition Status", condition.Status,
"Message", condition.Message)
}
}
}
}
shouldDelete, reason := shouldDeletePod(workerPod, rayv1.WorkerNode)
logger.Info("reconcilePods", "worker Pod", workerPod.Name, "shouldDelete", shouldDelete, "reason", reason)
if shouldDelete {
Expand Down

0 comments on commit 9f67eae

Please sign in to comment.