Skip to content

Commit 9ef78c7

Browse files
authored
docs: configure the DevWorkspace cleanup job (#1421)
Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent 57a2a4f commit 9ef78c7

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/dwo-configuration.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,33 @@ name `devworkspace-operator-config` and exists in the namespace where the DevWor
7676
not already exist on the cluster, you must create it.
7777
- You'll need to terminate the `devworkspace-controller-manager` pod so that the replicaset can recreate it. The new pod
7878
will update the `devworkspace-webhook-server` deployment.
79+
80+
## Configuring Cleanup CronJob
81+
82+
The DevWorkspace cleanup job helps manage resources by removing DevWorkspaces that have not been started for a configurable period of time.
83+
84+
**Note:** By default, the DevWorkspace cleanup job is disabled.
85+
86+
You can control the behaviour of the DevWorkspace cleanup job through the `config.workspace.cleanupCronJob` section of the global DWOC::
87+
88+
```yaml
89+
apiVersion: controller.devfile.io/v1alpha1
90+
kind: DevWorkspaceOperatorConfig
91+
metadata:
92+
name: devworkspace-operator-config
93+
namespace: $OPERATOR_INSTALL_NAMESPACE
94+
config:
95+
workspace:
96+
cleanupCronJob:
97+
enabled: true
98+
dryRun: false
99+
retainTime: 2592000
100+
schedule: "0 0 1 * *"
101+
```
102+
103+
Cleanup CronJob configuration fields:
104+
105+
- **`enable`**: Set to `true` to enable the cleanup job, `false` to disable it. Default: `false`.
106+
- **`schedule`**: A Cron expression defining how often the cleanup job runs. Default: `"0 0 1 * *"` (first day of the month at midnight).
107+
- **`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).
108+
- **`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`.

0 commit comments

Comments
 (0)