我注意到我的任务状态仍悬而未决时被标记为“正在运行”。有没有一种方法可以从作业资源本身获取实际状态而无需查看pod资源?
工作:
$ 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
吊舱:
$ 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.
答案 0 :(得分:1)
是的,作业系统将“完成并成功”,“完成并失败”和“仍在进行中”理解为状态。运行表示它已要求作业运行,而不是按字面意思执行。