Interview Prep/Kubernetes/Deployments and rollouts

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 →

  1. Use a Job for one-off work and a CronJob for scheduled work
  2. Set backoffLimit, activeDeadlineSeconds and ttlSecondsAfterFinished
  3. On CronJob set concurrencyPolicy: Forbid to avoid overlapping runs and successfulJobsHistoryLimit
  4. Use restartPolicy: OnFailure or Never, never Always
  5. 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.

All Kubernetes questions Roadmap: Kubernetes core

More on Deployments and rollouts