moonbeam-nyc / snorlax

wake and sleep Kubernetes deployments on a schedule
https://moonbeam.nyc
Apache License 2.0
147 stars 10 forks source link

Feature Request: Support list of deployments #1

Closed kehralexander closed 3 months ago

kehralexander commented 3 months ago

Why?

We have some software consisting of multiple deployments, of which have to be awake in the middle of the night to do some scheduled tasks. Instead of waking up the whole instance, in our case it would be better to just don't put some parts of the application to sleep.

Alternatives?

I guess we could create a SleepSchedule per deployment? I'm not sure how/if it's possible to wake up then on an incoming request. Supporting multiple deployments per SleepSchedule would be a cleaner solution IMHO.

azlyth commented 3 months ago

Hey! Currently, yeah, the way to achieve that would be to make a sleep schedule per deployment. I can see how having a list of deployments and ingresses would be nice though, because hitting one of the services would wake an entire set of deployments up.

I'll be adding some form of this functionality soon, so I'll definitely keep this suggestion in mind!

antoniomacri commented 3 months ago

Or something like a wildcard? I'd like to do that on all deployments of a namespace.

azlyth commented 3 months ago

@m3shat @antoniomacri I've just released v0.4.0, which now takes a list of deployments and ingresses:

apiVersion: snorlax.moonbeam.nyc/v1beta1
kind: SleepSchedule
metadata:
  namespace: your-app-namespace
  name: your-app
spec:
  wakeTime: '8:00am'
  sleepTime: '10:00pm'
  timezone: 'America/New_York'
  deployments:
  - your-app-frontend
  - your-app-db
  - your-app-redis
  ingresses:
  - your-app-ingress
azlyth commented 3 months ago

@antoniomacri Gonna add supporting wildcards to the list