For a deployed Kubernetes CronJob named foo
, how can I manually run it immediately? This would be for testing or manual runs outside its configured schedule.
Asked
Active
Viewed 3,794 times
5
![](../../users/profiles/57357.webp)
Dan Tanner
- 1,739
- 2
- 19
- 34
1 Answers
7
You can start a job based on an existing job's configuration, and a cronjob is just another type of job.
Syntax:
kubectl create job --from=cronjob/$CronJobName $NameToGiveThePodThatWillBeCreated
e.g.:
kubectl create job --from=cronjob/foo foo-manual-1
![](../../users/profiles/57357.webp)
Dan Tanner
- 1,739
- 2
- 19
- 34