Published : 2019-11-12

Trigger Kubernetes cronjob manually

Kubernetes cronjob are executed periodically. As they are a single object spawning jobs, if we want to run one periodically we can create manually a job from a cronjob :

kubectl -n my-namespace create job --from=cronjob/my-cronjob my-job-manual-1

We here create the job my-job-manual-1 from the cronjob my-cronjob inside my-namespace namespace.

Warning : the job and associated pods will not be reclaimed after some cronjob pass.