0

I want to schedule the deployments according to different timings. Is it possible to configure in the deployment.yml files that the deployment should be scaled to 0 at some hour and scaled up again at some other time (Saving costs)?

Can the openshift job scheduler be used to achieve something like this?

What are the possibilities to achieve such a result?

4
  • You could use two Cron Jobs that patch your deployment's replica count at specific times, one to set it to a higher value at some hour and another to set it to the lower count at a different time. Commented Mar 16, 2021 at 10:49
  • shoudl the cron jobs be written on the openshift nodes? or is possible to write it with the deployment yaml? Commented Mar 16, 2021 at 11:47
  • You can and probably should declare the cronjobs in the deployment, as they are valid resources for k8s: kubernetes.io/docs/concepts/workloads/controllers/cron-jobs Commented Mar 18, 2021 at 8:45
  • I was able to create 2 cronjobs which would stop and start the deployments. I will add the cronjob that i used as an answer Commented Mar 18, 2021 at 12:19

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.