You have to run a one-off task and a nightly job. Which workload objects do you use and what settings matter?
IntermediateScenarioDeployments and rollouts
Answer
Situation read → Ops wants a nightly report and a one-time data fix in the cluster.
What I'd do →
- Use a Job for one-off work and a CronJob for scheduled work
- Set
backoffLimit,activeDeadlineSecondsandttlSecondsAfterFinished - On CronJob set
concurrencyPolicy: Forbidto avoid overlapping runs andsuccessfulJobsHistoryLimit - Use
restartPolicy: OnFailureorNever, neverAlways - Test by
kubectl create job --from=cronjob/report manual-1
Why → Jobs track completions, retries and cleanup, which Deployments do not.
Interview tip → Mention timeZone field on CronJob (stable since 1.27) to avoid UTC surprises.
More on Deployments and rollouts
You applied a new image tag and the rollout seems stuck at "1 out of 3 new replicas have been updated". What do you check first?BeginnerHow do you roll back a bad release and verify you are back on the previous version?BeginnerA rollout must never reduce capacity below current replicas. How do you configure the strategy?IntermediateYou need a blue/green deployment without a service mesh. How do you do it with plain Kubernetes?IntermediateHow would you do a canary release with only Deployments and a Service?IntermediateWhat is the difference between Recreate and RollingUpdate strategies and when would you pick Recreate?Beginner