Welcome to the Linux Foundation Forum!

Lesson Design Lab 4.3 page 2 contains an error

m.ramah
m.ramah Posts: 9
edited March 9 in LFD259 Class Forum

https://trainingportal.linuxfoundation.org/learn/course/kubernetes-for-developers-lfd259/design/lab-exercises?page=3

This example asks the user to add the activeDeadlineSeconds field to the spec of the pod that is created by the job. This is wrong. It should be added to the spec of the job template itself. So right above template:. Trying to run the current example gives the following error:

Error from server (BadRequest): error when creating "cronjob.yaml": CronJob in version "v1" cannot be handled as a CronJob: strict decoding error: unknown field "spec.jobTemplate.spec.template.activeDeadlineSeconds"

Answers

  • chrispokorni
    chrispokorni Posts: 2,587
    edited March 10

    Hi @m.ramah,

    The example in the lab guide is correct. The error points out that you have incorrectly placed and indented the activeDeadlineSeconds field. Its current placement as spec.jobTemplate.spec.template.activeDeadlineSeconds is unrecognized by the API, hence the error you see. According to the lab guide, and the official documentation, it should be placed as spec.jobTemplate.spec.template.spec.activeDeadlineSeconds. Please review and correct your manifest, and perhaps inspect the official documentation for additional insight about the configuration of the CronJob, Job, and Pod respectively.

    Regards,
    -Chris

Categories

Upcoming Training