gpt4 book ai didi

即使超过时间,Kubernetes Cronjob 也会立即触发 Job

转载 作者:行者123 更新时间:2023-12-02 11:36:47 26 4
gpt4 key购买 nike

我有 Kubernetes 工作,每天早上 5 点运行。今天我想把它改成早上 6 点。我现在的时间是上午 10 点。

将时间从早上 5 点修改为早上 6 点后,我注意到即使我当前时间是上午 10 点,Kubernetes Cronjob 也会立即触发作业。

这是什么原因?是否有任何参数可用于启用/禁用此行为?

apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: do-not-want-to-reveal
namespace: default
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 2
jobTemplate:
metadata:
creationTimestamp: null
spec:
backoffLimit: 1
template:
metadata:
creationTimestamp: null
spec:
containers:
- image: myrepo/myimage:mytag
imagePullPolicy: Always
name: do-not-want-to-reveal
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext: {}
serviceAccount: myjob-sa
serviceAccountName: myjob-sa
terminationGracePeriodSeconds: 30
schedule: 00 5 * * *
successfulJobsHistoryLimit: 2
suspend: false
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.9", GitCommit:"16236ce91790d4c75b79f6ce96841db1c843e7d2", GitTreeState:"clean", BuildDate:"2019-03-25T06:30:48Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

最佳答案

这是 CronJob 的已知行为。 .它为“错过”的时间表创建工作。看看这个 Unresolved 问题 - https://github.com/kubernetes/kubernetes/issues/63371

关于即使超过时间,Kubernetes Cronjob 也会立即触发 Job,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59677719/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com