Kubernetes职位状态条件列表? [英] List of Kubernetes status conditions for jobs?

查看:97
本文介绍了Kubernetes职位状态条件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有资源概述kubernetes作业可能具有的所有可能的状态条件?

我想知道是因为我想检查一下,当我运行一个作业时是否已经在运行,如果已经运行,请退出新作业.

我遇到过很多次until kubectl get jobs myjob -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep True ; do sleep 1 ; done,但是我想知道它是否正在运行,而不是它是否已经完成.不想等待(ha)的kubectl 1.11等待功能

解决方案

True或False status.

除了作业状态条件数组之外,如果您只是对作业是否完成感兴趣,还可以查看作业状态active计数以及startTimecompletionTime信息. /p>

Is there any resource out there that gives an overview of all the possible status conditions a kubernetes job can have?

I'm wondering because I would like to check, when I run a job if it is already running and if so, exit the new job.

I came across until kubectl get jobs myjob -o jsonpath='{.status.conditions[?(@.type=="Complete")].status}' | grep True ; do sleep 1 ; done quite a few times but I want to know if it is running, not if it is already complete. Would prefer not to wait (ha) for kubectl 1.11 wait functionality

解决方案

https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#jobcondition-v1-batch implies the only type values are "Complete" and "Failed", and that they may have a "True" or "False" status.

In addition to the job status conditions array, you may also find it informative to look at the job status active count, and the startTime and completionTime if you’re just interested in whether it’s finished.

这篇关于Kubernetes职位状态条件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆