Kubernetes and Cloud Native Associate (KCNA) — Question 53
A CronJob is scheduled to run by a user every one hour. What happens in the cluster when it's time for this CronJob to run?
Answer options
- A. Kubelet watches API Server for CronJob objects. When it's time for a Job to run, it runs the Pod directly.
- B. Kube-scheduler watches API Server for CronJob objects, and this is why it's called kube-scheduler.
- C. CronJob controller component creates a Pod and waits until it finishes to run.
- D. CronJob controller component creates a Job. Then the Job controller creates a Pod and waits until it finishes to run.
Correct answer: D
Explanation
The correct answer is D because the CronJob controller creates a Job, and then the Job controller is responsible for creating the Pod that executes the task. Options A and B are incorrect as they misattribute the actions to the Kubelet and Kube-scheduler, respectively, while option C incorrectly states that the CronJob controller creates a Pod directly without involving a Job.