Administration

This section contains configuration options that are available to the Rok administrator to fine-tune a Rok installation. Note that all examples follow the Edit-Commit-Apply workflow, which involves editing the corresponding YAML manifests inside your local GitOps deployment repository, committing your changes and re-applying the manifests.

Configure the garbage collection of Rok tasks

By default, successful Rok tasks are garbage collected after one week, and all other tasks are garbage collected after one month. You can modify this behavior by providing a custom value for the following configuration variables:

  • gw.task_gc.all.cronspec: A cron schedule expression for the garbage collection of all tasks, regardless of their outcome. The default is to run daily at 03:00. Set this to an empty string to disable garbage collection for all tasks.
  • gw.task_gc.all.max_age: The time interval after which a task is being deleted. The default is 1 month. Set this to 0 to disable garbage collection for all tasks.
  • gw.task_gc.success.cronspec: A cron schedule expression for garbage collecting only successful tasks. The default is to run daily at 04:00. Set this to an empty string to disable garbage collection for successful tasks.
  • gw.task_gc.success.max_age: The time interval after which a successful task is being deleted. You can set this to a shorter duration than gw.task_gc.all.max_age to enable garbage collecting successful tasks earlier. The default is 1 week. Set this to 0 to disable garbage collection for successful tasks.

For example, to decrease the duration for which successful tasks are retained to 3 days and run garbage collection for successful tasks every 8 hours, perform the following steps:

  1. Go to the deployment repository:

    $ cd ~/ops/deployments
  2. Edit rok/rok-cluster/overlays/deploy/patches/configvars.yaml and add the gw.task_gc.success.max_age: "3 days" and gw.task_gc.success.cronspec: "0 */8 * * *" configuration variables, as follows:

    ... configVars: ... gw.task_gc.success.max_age: "3 days" gw.task_gc.success.cronspec: "0 */8 * * *"
  3. Commit the new options:

    $ git add rok/rok-cluster/overlays/deploy $ git commit -m "GC successful Rok tasks after 3 days"
  4. Re-apply the Rok cluster overlay:

    $ kubectl apply -k rok/rok-cluster/overlays/deploy