Usage Instructions for Cron Job System
The new cronjobs provide users with the following features:
- Create a cronjob
- Modify a cronjob
- Delete a cronjob
- View all cronjob for a namespace
- View the details of a cronjob under a namespcae
- View the execution status of a cronjob
- View a task log
View a list of cronjob created and the details of a cronjob.
Click on cronjob to enter the cronjob list, where you can see all of the cronjobs under the user name. Click on a cronjob to see the details of the cronjob. Click on the execution record to see the execution status of the task. Click delete to delete the cronjob after confirmation.
Create a cronjob
There are several elements to creating a cronjob:
- cronjob name: When creating a cronjob, the user needs to complete the cronjob name in order to to uniquely identify the cronjob. The name must begin and end with lowercase letters, and contain no more than 64 characters.
- space: Select a namespace to place the cronjob.
- cron expression: A specific description of a cron expression can be found in Introduction to Cron Expressions . The cron expression must conform to the appropriate format, otherwise it cannot be successfully created.
- docker image: This is the name of the docker image
- Image repository Secrets: Select corresponding image repository Secrets, created in configuration management
- Start command: Not required, complete start command using array format
- Start command parameter: Not required, complete start command using array format
- Memory limit: greater than or equal to 64, less than or equal to 4096
- Number of saved records of successful execution: This option sets the number of successful task records to be saved after cronjobs are completed. Automatic clean up by the system when the number is exceeded.
- Number of saved records of failed execution: This options sets the number of failed task records to be saved after cronjobs are completed. Automatic clean up by the system when the number is exceeded.
- Timeout for startup of cronjobs (seconds): This option sets the timeout time for task startup.
- Environment variables: Not required. Environment variables are either set directly or selected from configMap. Press add to add a new group of environment variables.
Complete the relevant sections according to the above list and click the Create a cronjob button in order to create a cronjob. cronjobs run automatically according to cron expression rules.
Modify a cronjob that has already been created
After entering the interface to view the details of a cronjob, click the Modify button to make all modifiable content editable. Modify the content, then click the Modify cronjob button to modify the cronjob.
Delete a cronjob that has already been created
In the View Task List page, click the Delete button. The message "Do you want to delete the cronjob?" will appear; select Yes to delete the cronjob.
View the task execution status for cronjobs
On the view task list page, click the View Record button to see a list of the task execution status for cronjobs. The specific number is related to the number of saved records of successful execution and number of saved records of failed execution. Each task record shows the task name, the task namespace, the start time, the end time, the number of successes, the number of failures, and the number of running tasks. When the task is running, if the previous task is not completed, the next task will wait for the previous task to complete.
View a task log
After entering the task execution interface for cronjobs, click the View Log button to view the log of a task.