Kubernetes: delete pod periodically


I would like to delete a pod periodically, for example every day at 3:00 AM, or in the equivalent, scale down to zero and scale up to 1 again, either mechanism would be good.

What would be the most appropriate way to do this in kubernetes ?

-- jmhostalet

1 Answer


While kubernetes have two different resource for this kind of things, one is "cronjobs" which is native in kubernetes for repeat jobs like crontab in linux, and another things is "jobs" which is also native for one-time task.

Here is the related link.


And also for your scenario, you have to also solve some authorization things to make the cronjob can have right permission to do this.

-- c0rehe110
Source: StackOverflow