1

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.
    – kalatabe
    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?
    – Vini
    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
    – kalatabe
    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
    – Vini
    Mar 18, 2021 at 12:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.