0
0
Kubernetesdevops~5 mins

Jobs and CronJobs for batch processing in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Kubernetes Job?
A Kubernetes Job runs a task to completion. It creates one or more pods and ensures they finish successfully. Once done, the Job stops.
Click to reveal answer
beginner
What is a CronJob in Kubernetes?
A CronJob runs Jobs on a schedule, like a clock. It creates Jobs repeatedly at specified times, similar to a calendar alarm.
Click to reveal answer
intermediate
How does a Job ensure a task completes successfully?
A Job creates pods and watches them. If a pod fails, the Job starts a new pod until the task finishes successfully.
Click to reveal answer
beginner
What is the key field to set the schedule in a CronJob YAML?
The key field is spec.schedule. It uses cron format like "*/5 * * * *" to run every 5 minutes.
Click to reveal answer
intermediate
What happens if a CronJob's previous Job is still running when the next schedule starts?
By default, Kubernetes may skip starting a new Job if the previous one is still running, to avoid overlap. This behavior can be controlled with concurrencyPolicy.
Click to reveal answer
What does a Kubernetes Job do?
AManages network traffic
BRuns continuously without stopping
CSchedules tasks repeatedly on a timer
DRuns a task to completion and stops
Which field defines the schedule for a CronJob?
Aspec.schedule
Bmetadata.name
Cspec.template
Dspec.replicas
What happens if a Job pod fails before completion?
AThe pod restarts automatically without Job intervention
BThe Job stops immediately
CThe Job creates a new pod to retry
DThe Job deletes itself
What is the default behavior if a CronJob's previous Job is still running at the next schedule?
ASkip starting a new Job
BStart a new Job anyway
CDelete the old Job
DSend an alert
Which Kubernetes resource would you use to run a task every day at midnight?
AJob
BCronJob
CDeployment
DService
Explain the difference between a Kubernetes Job and a CronJob.
Think about one-time tasks versus scheduled repeated tasks.
You got /3 concepts.
    Describe how Kubernetes handles a Job pod failure during batch processing.
    Focus on Job's retry mechanism.
    You got /3 concepts.