Garbage Collector
The Okteto Garbage Collector (GC) allows Admins to optimize infrastructure usage by automatically scaling down or deleting inactive Namespaces and Preview Environments, helping control costs and improve resource efficiency.
Enabling the Garbage Collector
The Garbage Collector is enabled by default in Okteto installations. If your GC has been disabled, navigate to Admin → Garbage Collector and flip the toggle to "Enabled" to begin using it. Once enabled, the GC automatically scales idle environments to zero and deletes unused Namespaces and Preview Environments based on your configured settings.
Configuring the Sleep and Delete Periods
Admins can set custom sleep and delete periods for both Namespaces and Preview Environments:
- Sleep Period: The amount of time, in hours, that an environment must remain idle before the GC scales it down to zero
- Delete Period: The number of days an environment must stay in a sleeping state before the GC permanently deletes it
Default Values:
-
Namespaces
- Sleep period: 3h
- Delete period: 14 days
-
Preview Environments
- Sleep period: 1h
- Delete period: 7 days
Manually Sleeping Resources
The Okteto Garbage Collector automatically scales inactive applications to zero if they haven't been used for longer than the sleep
period set to automatically save resources in your cluster.
Additionally, Namespaces can be manually scaled to zero by navigating to Admin -> Namespaces and clicking on the three dots on the right side of the Namespace that you wish to sleep.