Job status is marked as Running when the pod is still pending for being scheduled

9/28/2019

I noticed my job status is marked as Running when its pod is still pending for being scheduled. Is there a way to get the actual status from the job resource itself without looking at the pod resource?

Job:

$ kubectl describe jobs sample-job
Name:           sample-job
...
Start Time:     Sat, 28 Sep 2019 13:19:43 -0700
Pods Statuses:  1 Running / 0 Succeeded / 0 Failed
Events:
  Type    Reason            Age    From            Message
  ----    ------            ----   ----            -------
  Normal  SuccessfulCreate  2m16s  job-controller  Created pod: sample-job-ppcpl

Pod:

$ kubectl describe pods sample-job-ppcpl
Name:           sample-job-ppcpl
Status:         Pending
Controlled By:  Job/sample-job
Conditions:
  Type           Status
  PodScheduled   False 
...
Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  29s (x7 over 6m25s)  default-scheduler  0/1 nodes are available: 1 node(s) didn't match node selector.
-- Dagang
kubernetes

1 Answer

9/28/2019

Yes, the Job system understands "done and succeeded", "done and failed", and "still going" as statuses. Running means that it has requested that the job run, not that it's literally executing.

-- coderanger
Source: StackOverflow