How to set Inspection scheduling?

The inspection scheduling field uses Crontab expressions, which allow precise definitions of trigger times across dimensions such as minutes, hours, days, months, weeks, and years.

Main Features

Since Kubernetes operates on UTC (Universal Time Coordinated), when you set the triggering rules for scheduled tasks, you need to first convert local time (e.g., Beijing Time) to UTC time, and then convert UTC time into Crontab expressions.

Converting UTC Time

Time Conversion Rule: Local Time - Time Zone Difference = UTC

Taking Beijing Time to UTC Time as an example:

Beijing is in the UTC+8 time zone, so the time difference between Beijing Time and UTC is 8 hours, and the time conversion rule is:

Beijing Time - 8 = UTC

Example 1: Beijing Time at 9:42 converts to UTC time: 42 09 - 00 08 = 42 01, meaning the UTC time is 01:42 AM.

Example 2: Beijing Time at 4:32 AM converts to UTC time: 32 04 - 00 08 = -68 03. If this is a negative number, it indicates the day before, requiring another conversion: -68 03 + 00 24 = 32 20, meaning the UTC time is 8:32 PM the previous day.

Writing Crontab Expressions

Basic Format: Minute Hour Day Month Week

Value Ranges

MinutesHoursDaysMonthsWeeks
[0-59][0-23][1-31][1-12] or [JAN-DEC][1-7] or [SUN-SAT]

The minutes, hours, days, months, and weeks fields allow for special characters, including:

  • ,: List separator for specifying multiple values. For example: 1,2,5,7,8,9.
  • -: User-defined value range. For example: 2-4, indicating 2, 3, 4.
  • *: Represents the entire time period. For instance, when used in minutes, it indicates every minute.
  • /: Used to specify increment values. For example: n/m indicates starting from n, incrementing by m.

An online conversion tool can be referred to at Crontab.guru.

Common Examples:

  • Inputting 30 18 25 12 * indicates that the task will trigger at 18:30:00 on December 25th.

  • Inputting 30 18 25 * 6 indicates that the task will trigger at 18:30:00 on the 25th of each month and every Saturday.

  • Inputting 30 18 * * 6 indicates that the task will trigger at 18:30:00 every Saturday.

  • Inputting * 18 * * * indicates that from the closest effective time of 18:00:00 onward, the task will be triggered every minute (including at 18:00:00).

  • Inputting 0 18 1,10,22 * * indicates that the task will trigger at 18:00:00 on the 1st, 10th, and 22nd of each month.

  • Inputting 0,30 18-23 * * * indicates that between 18:00 and 23:00 daily, the task will trigger at 00 and 30 minutes of every hour.

  • Inputting * */1 * * * indicates that the task will trigger every minute.

  • Inputting * 2-7/1 * * * indicates that the task will trigger every minute between 2 AM and 7 AM daily.

  • Inputting 0 11 4 * mon-wed indicates that the task will trigger at 11 AM on the 4th of each month and on Mondays to Wednesdays.