[JIRA] (JENKINS-59789) Cleanup/GC Jenkins Slaves when Jenkins Master is removed

0 views
Skip to first unread message

siegfried.kiermayer@sap.com (JIRA)

unread,
Oct 15, 2019, 6:00:10 AM10/15/19
to jenkinsc...@googlegroups.com
Sigi Kiermayer created an issue
 
Jenkins / Improvement JENKINS-59789
Cleanup/GC Jenkins Slaves when Jenkins Master is removed
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2019-10-15 09:59
Priority: Minor Minor
Reporter: Sigi Kiermayer

Hi,

 

we see the problem, that Jenkins Slaves are not cleaned up properly when the Jenkins Master is removed from Kubernetes.

 

We thought about multiply solutions (like a cronjob to clean them up) but we think the best approach would be to allow Kubernetes to clean them up by itself:

 

https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/

 

To be able to do so, the ownerReference field for Jenkins Slaves need to point to the Jenkins Master.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

siegfried.kiermayer@sap.com (JIRA)

unread,
Dec 18, 2019, 6:39:05 AM12/18/19
to jenkinsc...@googlegroups.com

luca.popesco@sap.com (JIRA)

unread,
Mar 31, 2020, 12:00:04 PM3/31/20
to jenkinsc...@googlegroups.com
luca popesco commented on Bug JENKINS-59789
 
Re: Cleanup/GC Jenkins Slaves when Jenkins Master is removed

In order to use the garbage collector, the master has to be aware of its own UID (or the UID of the stateful set it’s a part of) in the Kubernetes cluster in order to inject that value into the slave templates.

 

I’ve tried a few approaches in getting this value. As the master is aware of its own URL, you can try to use the ingress resource and follow that chain, but that proved slow and unreliable.

 

A more reliable way to get the value is to inject it as an environment variable at deployment-time, but that would make the plugin dependent on whatever method you use to deploy, which is not ideal.

 

We’ve implemented similar functionality through a helm delete hook, which we’d added to the Jenkins stable helm chart.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages