Command

Kubernetes Create a Cron Job Command

The Kubernetes command to create a cron job is kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World".

Quick Answer

Command
kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World"
KubernetesCommand

Create a Cron Job

Type this command
kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World"

Creates a cron job with a schedule that runs a command.

Learn More

How to create a cron job in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World", replace any placeholders, and run it.

Kubernetes Create a Cron Job Command

Run kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World".

Related Commands

Frequently asked questions

What is the Kubernetes command to create a cron job?

Run kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World".

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify