Skip to main content
Version: 1.21

Resource cleanup

Sleeping resources

To automatically save resources in your cluster, you can configure Okteto to automatically scale inactive applications and resources to zero if they haven't been used for longer than the inactivity period.

Learn how to configure this in the configuration steps.

Inactive Applications and Resources

Okteto considers an application or resources inactive if a user hasn't performed any of the following tasks during the inactivity period:

  • Upgrade or redeploy via the UI or the command line.
  • Launched a development container with okteto up.
  • Pushed the latest version of your code with okteto push.

Service accounts, config maps, secrets, or volumes you create will be unaffected by this operation.

Wake sleeping resources

Okteto's UI will notify you when there are sleeping resources in your namespace. Press the Wake all button to activate all sleeping resources at once.

wake a sleeping resource

Sleeping resources are also started if anyone visits any of the public endpoints of your application.

Delete Unused Namespaces

Namespaces and all the resources and data contained within will be deleted if they are not used for longer than the deletion period.

Persistent resources
ScaleEnterpriseSelf-Hosted

In case you are interested on the garbage collector but you want to skip some specific namespace, you can mark it as persistent. To do so, you can add the label dev.okteto.com/persistent to it or use the admin view.

In case you want more granularity and only want to persist specific deployments or statefulsets within a namespace, you can include the label dev.okteto.com/persistent on those resources. In that case, the garbage collector will ignore only those specific resources while scaling down the rest of the namespace.

Configuration Steps
ScaleEnterpriseSelf-Hosted

You can consult the deletion and inactivity periods in the Admin Dashboard.

You can enable and customize the inactivity and deletion periods via the garbage collector's settings.