Create a CronJob from the CLI.
Section: Imperative Resource Creation
Create cronjob
bash
bash
kubectl create cronjob db-backup --image=alpine:3.20 --schedule='0 2 * * *' -- sh -c 'echo backup'Explanation
Create a CronJob from the CLI.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Imperative Resource Creation