Hey everyone, I'm trying to find a reliable method to schedule my Kubernetes deployments, specifically to start them at certain times and stop them later. The typical CronJob doesn't really work for my case since it's more tailored for batch operations like backups. What I need is something that can handle long-running deployments and manage their timing effectively. I'm open to learning about any tools, native Kubernetes features, operators, or external orchestrators that can help with this. Thanks in advance for your suggestions!
4 Answers
Have you thought about using Airflow with the Kubernetes Job Operator? Another fantastic tool you could explore is Argo Workflows, which is designed to manage Kubernetes jobs. I think a combination of Airflow and a process engine could meet your needs pretty well!
You can set up a CronJob to scale your deployment up at a specific time, like 7 AM, and then create another one to scale it down later on by setting replicas to zero. Just remember to configure RBAC properly. This is a pretty straightforward approach if you only have one or two deployments. If you're managing more workloads, you might want to check out KEDA for a more scalable solution.
For interesting options, you might want to look at Sablier or Snorlax on GitHub. They have some functionalities that could work for scheduling deployments.
KEDA is a great option since it can scale down your deployment to zero using their CronScaler Custom Resource Definition (CRD). You can find more information about it on their official site. It provides a lot of flexibility for scheduling.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures