Nice, I will start off your master then.

And yes, a) might actually not be fixed by using Jobs. I will continue 
researching and report back.

Regards,
Daniel

Am Donnerstag, 22. November 2018 16:42:04 UTC+1 schrieb Carlos Sanchez:
>
> It's not using jobs because they did not exist when the plugin was 
> created, and yes, it would be a good addition to the plugin.
>
> Note that I don't think it would fix a) as Jenkins expects the agent to 
> keep state. ie. agent clones git repo then crashes later on, Jenkins 
> expects the agent to already have the gi repo cloned after agent restart
>  
>
> On Thu, Nov 22, 2018 at 4:04 PM <[email protected] <javascript:>> 
> wrote:
>
>> Hi all,
>>
>> I am working on a kubernetes cluster for Jenkins. I quickly found Carlos 
>> Sanchez' kubernetes-plugin and started using and adapting it.
>> The plugin creates "bare" Pods directly in kubernetes, watches and in the 
>> end deletes them after the agent process inside the Pod terminated.
>> I think there are several issues with this:
>> a) bare Pods do not get rescheduled in failover cases, for example node 
>> crash
>> b) kubernetes-plugin is responsible for deleting such a bare Pod (because 
>> Pods are designed to never terminate). If Jenkins (or the node its running 
>> on)
>> crashes while terminating the slave, it might never actually delete the 
>> Pod.
>> c) kubernetes-plugin immediately deletes the Pod after the build inside 
>> the container is finished. If something else is happening inside the Pod 
>> after
>> the build (e. g. cleanup or syncing), it has no chance of completing.
>>
>> While researching, I found out that kubernetes provides a "Job" object 
>> that runs a certain amount of containers until successful completion. 
>> Using a kubernetes Job to schedule builds onto the cluster seems to solve 
>> all my aforementioned issues.
>> a) a Job ensures that the specified number of completed runs are 
>> achieved, even in case of failover
>> b) and c) a Job automatically deletes all associated Pods when it gets 
>> deleted (and finished Jobs themselves can get auto-deleted with
>> the new alpha feature TTLAfterFinished in k8s v1.12). This frees the 
>> kubernetes-plugin from caring for the Pods after build completion.
>>
>> Has anyone experience with kubernetes Jobs? Am I missing something 
>> obvious?
>>
>> @Carlos Sanchez: If not, I would try to implement this in your 
>> kubernetes-plugin. Would you be interested to get this back into your
>> mainline? Then I would fork the github repo and start directly off master.
>>
>> Regards,
>> Daniel
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/1fe306b4-f8f6-48b1-a98a-087b119f880f%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/1fe306b4-f8f6-48b1-a98a-087b119f880f%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/25d96a14-4d8d-407d-aa21-ead2188b08af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to