ibotty / openshift-letsencrypt

MIT License
59 stars 31 forks source link

Scheduled Jobs #20

Open sandrich opened 7 years ago

sandrich commented 7 years ago

Fantastic work. Just what I need. Thanks for that.

One idea. Instead of continuously running the containers could this also be done with ScheduledJob?

ibotty commented 7 years ago

Yes ScheduledJob is the right way to replace cron, and Job might be the right way to decouple the controller from the requesting of certificates. Unfortunately ScheduledJobs are only supported starting with origin 1.5, I don't know when 1.3 and 1.4 get out of support. AFAIR 1.3 does not even support Jobs.

Having said that, I am very willing to discuss a Job-based future of this project. My basic idea was that the route-certificate controller (now the watcher container's part that gets the routes) only schedules jobs that get one certificate. There would be a scheduled job that checks old certificates and schedules said jobs when necessary. I wonder whether combining requesting many certificate in one container (as is done now) is worth it or not. If needing that, it will further complicate the code.

Does anyone have any other ideas, comments?

caruccio commented 7 years ago

Kubernetes 1.4 does supports ScheduledJobs. Since 1.5 its renamed CronJob. More here https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/

Em 16 de jun de 2017 05:49, "Tobias Florek" notifications@github.com escreveu:

Yes ScheduledJob is the right way to replace cron, and Job might be the right way to decouple the controller from the requesting of certificates. Unfortunately ScheduledJobs are only supported starting with origin 1.5, I don't know when 1.3 and 1.4 get out of support. AFAIR 1.3 does not even support Jobs.

Having said that, I am very willing to discuss a Job-based future of this project. My basic idea was that the route-certificate controller (now the watcher container's part that gets the routes) only schedules jobs that get one certificate. There would be a scheduled job that checks old certificates and schedules said jobs when necessary. I wonder whether combining requesting many certificate in one container (as is done now) is worth it or not. If needing that, it will further complicate the code.

Does anyone have any other ideas, comments?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ibotty/openshift-letsencrypt/issues/20#issuecomment-308970733, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhBCHj0GGqwgJ6d6pp9yE4cZtCPUn_Fks5sEkGXgaJpZM4N8ImD .

ibotty commented 7 years ago

Oh, I misremembered. Fortunately the differences between CronJob and ScheduledJob won't matter much (only the openshift-letsencrypt template would be have to change, not the code to manage jobs).

@caruccio Can you tell me whether jobs work with origin 1.3? If so, we could go ahead with above plan starting now.

caruccio commented 7 years ago

Yes they do! Swagger has the complete definition of it https://github.com/kubernetes/kubernetes/blob/release-1.3/api/swagger-spec/batch_v1.json

Em 16 de jun de 2017 06:13, "Tobias Florek" notifications@github.com escreveu:

Oh, I misremembered. Fortunately the differences between CronJob and ScheduledJob won't matter much (only the openshift-letsencrypt template would be have to change, not the code to manage jobs).

@caruccio https://github.com/caruccio Can you tell me whether jobs work with origin 1.3? If so, we could go ahead with above plan starting now.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibotty/openshift-letsencrypt/issues/20#issuecomment-308975969, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhBCFp96ScBJ7RvZ-50xjLePbjO620gks5sEkdIgaJpZM4N8ImD .

ibotty commented 7 years ago

Yeah, I know about kube 1.3 (I checked this exact swagger spec.) But sometimes openshift origin disables certain features even if they are in their swagger spec, e.g. ThirdPartyResources.

Thank you anyway! Very appreciated.

caruccio commented 7 years ago

Well, I'm using thirdpartyresources since openshift 1.3

Em 16 de jun de 2017 06:39, "Tobias Florek" notifications@github.com escreveu:

Yeah, I know about kube 1.3 (I checked this exact swagger spec.) But sometimes openshift origin disables certain features even if they are in their swagger spec, e.g. ThirdPartyResources.

Thank you anyway! Very appreciated.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ibotty/openshift-letsencrypt/issues/20#issuecomment-308981461, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhBCKY6KGl3WPmbn1d65z1jyKXf3EwLks5sEk08gaJpZM4N8ImD .

ibotty commented 7 years ago

Huh? That did not work for me. See openshift/origin#8622. Maybe I am missing something, but my testing did confirm that they would not be supported until they are stable.