首页 > 解决方案 > Job status is marked as Running when the pod is still pending for being scheduled

问题描述

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.

标签: kubernetes

解决方案


是的,作业系统将“完成并成功”、“完成并失败”和“仍在进行中”理解为状态。运行意味着它已请求作业运行,而不是它实际上正在执行。


推荐阅读