kubectl Jobs & CronJobs commands
27 commands in 4 groups: Jobs Manage, CronJobs Manage, Jobs List & Inspect, CronJobs List & Inspect. Click or tap any command to copy it. Official documentation: kubernetes.io.
Open in the interactive cheat sheet search, stars and every other section
Jobs Manage
Create jobs imperatively, trigger CronJobs manually, and clean up completed runs.
kubectl apply -f job.yaml
Apply job from manifest
kubectl create job <name> --from=cronjob/<cron>
Trigger a CronJob manually as a one-off job
kubectl create job <name> --image=<image>
Create a simple job imperatively
kubectl delete job <name>
Delete job and its pods
kubectl delete jobs --all -n <namespace>
Delete all jobs in a namespace
CronJobs Manage
Create, edit, suspend, resume, and delete CronJobs.
kubectl apply -f cronjob.yaml
Apply CronJob from manifest
kubectl create cronjob <name> --image=<image> --schedule='*/5 * * * *'
Create a CronJob imperatively
kubectl delete cronjob <name>
Delete CronJob and the Jobs and pods it created
kubectl delete cronjobs --all -n <namespace>
Delete all CronJobs in a namespace
kubectl edit cronjob <name>
Edit CronJob in $EDITOR
kubectl patch cronjob <name> -p '{"spec":{"suspend":false}}'
Resume a suspended CronJob
kubectl patch cronjob <name> -p '{"spec":{"suspend":true}}'
Suspend a CronJob (stops new runs)
Jobs List & Inspect
List jobs, inspect their status, and find the pods they created.
kubectl describe job <name>
Full job details including conditions, pod statuses, and events
kubectl get jobs
List jobs in current namespace
kubectl get job <name> -o yaml
Get job manifest as YAML
kubectl get jobs -A
List all jobs across all namespaces
kubectl get jobs -n <namespace>
Jobs in a specific namespace
kubectl get pods --selector=job-name=<name>
Find all pods created by a job
kubectl logs -l job-name=<name>
Last 10 lines from each pod of a job (add --tail=-1 for all)
kubectl wait --for=condition=Failed job/<name>
Wait until job fails (useful in CI to catch errors)
kubectl wait --for=condition=Complete job/<name> --timeout=120s
Wait until job completes successfully
CronJobs List & Inspect
List CronJobs, check their schedule and last execution, and view the full spec.
kubectl describe cronjob <name>
Schedule, last run time, and events
kubectl get cj
Short alias for get cronjobs
kubectl get cronjobs
List CronJobs in current namespace
kubectl get cronjob <name> -o yaml
Get CronJob manifest as YAML
kubectl get cronjobs -A
List all CronJobs across all namespaces
kubectl get cronjobs -n <namespace>
CronJobs in a specific namespace