Explore the Jobs resource and how the pattern can be applied.

Jobs

Explore the Jobs resource and how the pattern can be applied.
Jobs

This lab takes you through the basics of Job resources on Kubernetes. Chapter 12 of the 2019 O’Reilly Kubernetes Up & Running, 2nd edition book from Kelsey Hightower , Brendan Burns , and Joe Beda has a very nice explanation of Jobs. Therefore, this lab is simply a manifestation of their explanation.

A Job creates Pods that run until successful termination (i.e., exit with 0). In contrast, a regular Pod will continually restart regardless of its exit code. Jobs are useful for things you only want to do once, such as database migrations or batch jobs. If run as a regular Pod, your database migration task would run in a loop, continually repopulating the database after every exit.

The Job object is responsible for creating and managing pods defined in a template in the Job specification. These pods generally run until successful completion. The Job object coordinates running multiple pods in parallel.

As a prerequisite, we assume you have an introductory working knowledge of Kubernetes covered in the First App lab of this course.

In this lab, you will learn how to:

    ☐ Define Jobs in Kubernetes
    ☐ Rely on Kubernetes resilience to recover failed jobs
    ☐ Run Jobs serially or in parallel
    ☐ Run Jobs to process a work queue

The Jobs feature is described in the Kubernetes documentation . More references to documentation are listed at the end of this lab.

  • LEVEL

    Intermediate

  • DURATION

    25 minutes

  • UPDATED

    31 Dec, 2021

Categories