From a6c6d48efd0a95ed37eff383862578295f2a9491 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Tue, 29 Apr 2025 16:08:00 +0300 Subject: [PATCH] docs: configure the DevWorkspace cleanup job Signed-off-by: Oleksii Kurinnyi --- docs/dwo-configuration.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/dwo-configuration.md b/docs/dwo-configuration.md index 972016980..8dd7be8d6 100644 --- a/docs/dwo-configuration.md +++ b/docs/dwo-configuration.md @@ -76,3 +76,33 @@ name `devworkspace-operator-config` and exists in the namespace where the DevWor not already exist on the cluster, you must create it. - You'll need to terminate the `devworkspace-controller-manager` pod so that the replicaset can recreate it. The new pod will update the `devworkspace-webhook-server` deployment. + +## Configuring Cleanup CronJob + +The DevWorkspace cleanup job helps manage resources by removing DevWorkspaces that have not been started for a configurable period of time. + +**Note:** By default, the DevWorkspace cleanup job is disabled. + +You can control the behaviour of the DevWorkspace cleanup job through the `config.workspace.cleanupCronJob` section of the global DWOC:: + +```yaml +apiVersion: controller.devfile.io/v1alpha1 +kind: DevWorkspaceOperatorConfig +metadata: + name: devworkspace-operator-config + namespace: $OPERATOR_INSTALL_NAMESPACE +config: + workspace: + cleanupCronJob: + enabled: true + dryRun: false + retainTime: 2592000 + schedule: "0 0 1 * *" +``` + +Cleanup CronJob configuration fields: + +- **`enable`**: Set to `true` to enable the cleanup job, `false` to disable it. Default: `false`. +- **`schedule`**: A Cron expression defining how often the cleanup job runs. Default: `"0 0 1 * *"` (first day of the month at midnight). +- **`retainTime`**: The duration time in seconds since a DevWorkspace was last started before it is considered stale and eligible for cleanup. Default: 2592000 seconds (30 days). +- **`dryRun`**: Set to `true` to run the cleanup job in dry-run mode. In this mode, the job logs which DevWorkspaces would be removed but does not actually delete them. Set to `false` to perform the actual deletion. Default: `false`.