Jobs & CronJobs¶
Helm-me allows you to declare one-off tasks (Jobs) and scheduled tasks (CronJobs) natively. Instead of long-running deployments, these components spin up, execute a command, and terminate.
Job Components¶
Jobs are stand-alone pods designed to run to completion once triggered. Unlike Deploy Hooks (which run automatically during helm-me deploy), a job component must be triggered manually using the CLI.
Running Jobs¶
To manually trigger a Job, use the helm-me job run command, specifying the name of the component:
If you want the CLI to block and wait for the job to complete successfully, pass the --wait flag:
CronJob Components¶
CronJobs create Kubernetes CronJob resources which automatically trigger Jobs on a predefined schedule using Cron syntax.
The schedule must be a valid Kubernetes cron expression (e.g., */5 * * * * for every 5 minutes).
CronJobs are deployed automatically alongside the rest of your app when you run helm-me deploy.
Shared Properties¶
Like web or worker components, both job and cronjob components support shared options such as:
envandsecret_refsresourcesfiles(inline ConfigMaps)inputs
[!NOTE] Jobs vs. Hooks Use Hooks (
hooks: dict) when a task must run as part of the deploy lifecycle (like a database migration before the new code boots). Use Jobs (type: job) when a task is situational, admin-driven, or triggered externally (like manually seeding a staging database or flushing a cache).