Editing Kubernetes CronJobs
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | <code>CronJob</code>s (previously ScheduledJobs) has been a beta feature since Kubernetes 1.8! With 1.21 we get to finally see this widely used API graduate to stable. | |
− | + | ||
+ | CronJobs are meant for performing regular scheduled actions such as backups, report generation, and so on. Each of those tasks should be configured to recur indefinitely (for example: once a day / week / month); you can define the point in time within that interval when the job should start. | ||
− | |||
− | |||
https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ | https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ | ||
[[apiVersion:]] batch/v1 | [[apiVersion:]] batch/v1 | ||
− | [[kind: | + | [[kind:]] CronJob |
− | + | metadata: | |
name: hello | name: hello | ||
spec: | spec: | ||
schedule: "*/1 * * * *" | schedule: "*/1 * * * *" | ||
− | + | jobTemplate: | |
− | + | spec: | |
template: | template: | ||
spec: | spec: | ||
containers: | containers: | ||
- name: hello | - name: hello | ||
− | + | image: [[busybox]] | |
imagePullPolicy: IfNotPresent | imagePullPolicy: IfNotPresent | ||
command: | command: | ||
Line 25: | Line 24: | ||
- date; echo Hello from the Kubernetes cluster | - date; echo Hello from the Kubernetes cluster | ||
restartPolicy: OnFailure | restartPolicy: OnFailure | ||
+ | |||
== Related == | == Related == | ||
− | * <code>[[ | + | * <code>[[Job]]</code>: <code>[[kind: Job]]</code> |
− | |||
* [[Jobs (Kubernetes)]] | * [[Jobs (Kubernetes)]] | ||
− | |||
− | |||
== See also == | == See also == |
Advertising: