我有 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"}