Kubernetes – Run cron job manually

Spread the love

If need to run Kubernetes CronJob manually from test purposes or etc, use:

kubectl create job --from=cronjob/cron_job_name job_name

where:

  • cron_job_name – Kubernetes CronJob that was created
  • job_name – any unique name. It will be used for pod name

Sample:

kubectl create job --from=cronjob/backup backup-manual-1

Be careful in the situation when your job uses persistent storage because in this case one job can be executed at one time.

Leave a Reply