Configure automatic cleanup of inactive workspaces
For large Kubernetes deployments, particularly those involving a high number of custom resources such as DevWorkspace objects, which represent CDEs, etcd can become a significant performance bottleneck. Configure the DevWorkspace Operator pruner to automatically delete workspaces that have not been started within a configurable retention period.
|
Based on the load testing for 6,000 |
-
An active
kubectlsession with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl. -
DevWorkspace Operator version 0.34.0 or later is installed on the cluster.
-
Configure the
DevWorkspaceOperatorConfigobject to enable the cleanup cron job:apiVersion: controller.devfile.io/v1alpha1 kind: DevWorkspaceOperatorConfig metadata: name: devworkspace-operator-config namespace: eclipse-che config: workspace: cleanupCronJob: enabled: true dryRun: false retainTime: 2592000 schedule: "0 0 1 * *"- retainTime
-
The number of seconds a workspace must be inactive before it is marked for deletion. The default value
2592000equals 30 days. - schedule
-
A cron expression that defines how often the pruner runs. The default value
"0 0 1 * *"runs the pruner once per month.
-
Optional: To preview which workspaces would be deleted without removing them, set
dryRuntotrue.
-
Verify that the cleanup cron job is scheduled:
$ kubectl get cronjobs -n eclipse-che