Welcome to the Linux Foundation Forum!

Lab 6.3 activeDeadlineSeconds placement between job and cronjob

IppX Posts: 1
edited August 2020 in LFS258 Class Forum


I noticed that in lab 6.3, when creating the Job we set activeDeadlineSeconds on the JobSpec object (https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#jobspec-v1-batch) but then for the CronJob we set it on the PodSpec object (https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#podspec-v1-core).
Is this wanted ?

AFAIK, the behavior is not the same. Terminating the pod will mark its status to DeadlineExceeded which does not terminate the job, new pods are reschedulded indefinitly which explains the output of kubectl get cronjob sleepy: the active counter is incremented for each new job as we can also see in the material screenshot (####). Whereas when put on the Job, the pods are evicted properly, jobs remain incomplete and the ACTIVE counter is at 1 when a job is running, 0 otherwise.

Thanks !


Upcoming Training