KCNA · Question #53
Imagine there is a requirement to run a database backup every day. Which Kubernetes resource could be used to achieve that?
The correct answer is B. CronJob. For recurring tasks like daily database backups in Kubernetes, a CronJob resource is the appropriate choice as it schedules Jobs to run periodically.
Question
Imagine there is a requirement to run a database backup every day. Which Kubernetes resource could be used to achieve that?
Options
- AKube-scheduler
- BCronJob
- CTask
- DJob
How the community answered
(45 responses)- A2% (1)
- B89% (40)
- C2% (1)
- D7% (3)
Why each option
For recurring tasks like daily database backups in Kubernetes, a CronJob resource is the appropriate choice as it schedules Jobs to run periodically.
The Kube-scheduler is a control plane component responsible for assigning newly created Pods to available nodes, not for scheduling recurring tasks.
A CronJob in Kubernetes is used to schedule Jobs to run periodically on a given schedule, similar to how cron operates in Unix-like systems. This makes it ideal for automated, time-based tasks like daily database backups or routine report generation.
While jobs perform tasks, 'Task' is not a standard, top-level Kubernetes resource type for scheduling recurring operations.
A Kubernetes Job creates one or more Pods and ensures that a specified number of them successfully terminate; it doesn't handle recurring scheduling, which is the role of a CronJob.
Concept tested: Kubernetes CronJob for scheduled tasks
Source: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
Topics
Community Discussion
No community discussion yet for this question.