Skip to content

Commit

Permalink
Krr scheduled cronjob scan (#936)
Browse files Browse the repository at this point in the history
* [MAIN-514] Cron trigger ability, KRR triggers

* [MAIN-514] Cron-based schedule documentation

* Poetry lock update

* Small refactor for cron delay calculation
  • Loading branch information
LeaveMyYard authored Jun 28, 2023
1 parent 96c97f4 commit f9a0b44
Show file tree
Hide file tree
Showing 7 changed files with 508 additions and 462 deletions.
15 changes: 15 additions & 0 deletions docs/playbook-reference/triggers/scheduled.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ a delay of 150 seconds the first time, 160 the second, and 170 the third.
delay_periods: [150, 160, 170]
The first delay cannot be less than 120 seconds. If you define less, 120 seconds will be used instead.


Cron based
----------------------

If you want to run a playbook on a `cron schedule <https://crontab.guru/>`_, you can use the following:

.. code-block:: yaml
triggers:
- on_schedule:
cron_schedule_repeat:
cron_expression: "0 12 * * 1" # every Monday at 12:00
If the first run should be in less than 120 seconds, the trigger will fire 120 seconds after the playbook is first configured.
12 changes: 12 additions & 0 deletions helm/robusta/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,18 @@ platformPlaybooks:
- popeye_scan: {}
sinks:
- "robusta_ui_sink"
- triggers:
- on_schedule:
fixed_delay_repeat:
repeat: 1
seconds_delay: 120
- on_schedule:
cron_schedule_repeat:
cron_expression: "0 12 * * 1" # every Monday at 12:00
actions:
- krr_scan: {}
sinks:
- "robusta_ui_sink"

# parameters for the robusta forwarder deployment
kubewatch:
Expand Down
Loading

0 comments on commit f9a0b44

Please sign in to comment.