Skip to content

Add Sleep/Wake Functionality #2

Description

@cstanislawski

Currently the controller lacks a way to scale workloads down to zero during idle periods.

We should introduce "sleep" and "wake" functionality to manage the replica count of pod-spawning resources based on a schedule or one-time trigger.

This feature would include:

  • New Annotations:

    • lifecycle.io/sleep-at: A specific time to scale the resource down to zero.
    • lifecycle.io/wake-at: A specific time to scale the resource back up.
    • lifecycle.io/sleep-cron: A cron schedule for scaling down.
    • lifecycle.io/wake-cron: A cron schedule for scaling up.
  • State Management:

    • When sleeping a resource, the controller will add a lifecycle.io/original-replicas annotation to store the replica count.
    • When waking the resource, it will restore the replica count from this annotation. If the annotation is missing, it will default to 1.
  • Behavioral Logic:

    • While a resource is sleeping (scaled to zero), the controller will only process wake or delete actions. Other scheduled actions like restarts will be paused.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions