配置
配置
spec:
activeDeadlineSeconds: 1800 # 30 分钟上限
backoffLimit: 2
template:
spec:
restartPolicy: Never
containers:
- name: task
image: registry.example.com/task:3.1查看超时状态
查看超时状态
kubectl get job batch-x -o jsonpath='{.status.conditions[*].reason}'
kubectl describe job batch-x | grep -i -A2 deadline超时后 Job 标记 Failed(reason: DeadlineExceeded),不再重试;与 backoffLimit 同时生效时先到者终止。