A weekly parking-citation export must fire on a calendar schedule. Which resource should wrap the batch work?
Select an answer to reveal the explanation.
Short Explanation
Weekly exports are alarm-clock work. A CronJob is the alarm: its schedule wakes a Job template, the Job does the export, and everyone goes back to sleep until next week.
Full Explanation
Weekly parking-citation exports need true calendar scheduling rather than clever hacks. Use a CronJob whose schedule field (standard five-field cron) creates Jobs from its jobTemplate on that cadence. Each fired Job runs export Pods to completion, which fits municipal reporting windows without leaving exporters idle and scheduled all week as Deployments.
A Deployment whose replicas oscillate between 0 and 1 using readiness-gate tricks is brittle, hard to audit, and not time-based scheduling. A Service with sessionAffinity timed to weekly intervals only affects client stickiness—it never creates batch Pods. A PersistentVolumeClaim that “triggers” Pods when capacity thresholds are crossed misunderstands PVCs: they bind storage; they do not schedule workloads when disks fill.
Exam caveat: Remember the CronJob → Job → Pod hierarchy. Operational knobs include suspend, concurrencyPolicy, and successfulJobsHistoryLimit/failedJobsHistoryLimit. Kubernetes schedule fields are minute hour day-of-month month day-of-week.
Operational check: kubectl get cronjobs; kubectl create job --from=cronjob/parking-export manual-test; inspect kubectl get jobs and kubectl describe cronjob for Last Schedule Time after the weekly window; fix suspend if Jobs never appear.