You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dwo-configuration.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,3 +76,33 @@ name `devworkspace-operator-config` and exists in the namespace where the DevWor
76
76
not already exist on the cluster, you must create it.
77
77
- You'll need to terminate the `devworkspace-controller-manager` pod so that the replicaset can recreate it. The new pod
78
78
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