Configuring cluster scheduling

Set a schedule for a NiFi cluster.

A field, clusterSchedule, defines the “up time” of your NiFi cluster. During the down time, the cluster is suspended which means all data and data flow configuration is still persisted. For more information, see Cluster Suspension.

The clusterSchedule supports two time formats for declaring a schedule: cron and time range.

Cron

The cron scheduler takes in a standard Cron expression and a run duration. The following example unsuspends the NiFi cluster once every three hours, starting at 00:00, and runs for one hour before suspending again.

spec:
  clusterSchedule:
    cron:
      schedule: "0 */3 * * *"
      runDuration: 1h

The runDuration field supports setting minutes (30m) and hours (2h) or a combination (2h30m).

TimeRange

TimeRange specifies two wall clock time instances between which the NiFi cluster will run. The following example runs daily between the hours of 12:00 and 13:00 UTC.

spec:
  clusterSchedule:
    timeRange:
      startTime: "12:00:00Z"
      stopTime: "13:00:00Z"

To configure timeRange to begin at night and finish in the morning, timeRange supports setting a stopTime that is earlier than the startTime. The following example begins running at 22:00 UTC and ends at 03:00 UTC the following day.

spec:
  clusterSchedule:
    timeRange:
      startTime: "22:00:00Z"
      stopTime: "03:00:00Z"

Both startTime and stopTime support numerical time offsets for timezones. For example, “12:00:00-04:00” is noon (12pm) in Eastern Standard Time and 16:00 in UTC.

NiFi resource conditions

The NiFi Resource Status will show a ClusterScheduled condition.

When there is no schedule, the condition status will be False and will indicate that there is no schedule.

  conditions:
  - lastTransitionTime: "2025-04-15T15:51:52Z"
    message: NiFi cluster has no schedule
    observedGeneration: 2
    reason: NoClusterSchedule
    status: "False"
    type: ClusterScheduled

When a schedule is set and the NiFi cluster is currently not running, the ClusterScheduled condition will have status True and state the time at which the cluster will be restored.

  conditions:
  - lastTransitionTime: "2025-04-15T20:45:12Z"
    message: NiFi cluster is scheduled to be restored at 2025-04-15T20:50:00Z
    observedGeneration: 1
    reason: ClusterScheduledForRestoration
    status: "True"
    type: ClusterScheduled

When a schedule is set and the NiFi cluster is currently running, the ClusterScheduled condition will have status True and state the time at which the cluster will be suspended.

  conditions:
  - lastTransitionTime: "2025-04-15T20:45:12Z"
    message: NiFi cluster is scheduled to be suspended at 2025-04-15T20:48:00Z
    observedGeneration: 1
    reason: ClusterScheduledForSuspension
    status: "True"
    type: ClusterScheduled