Kubernets Plugin: Automatically have podTemplate inherit global defaults

43 views
Skip to first unread message

ape...@shoprunner.com

unread,
Jul 10, 2018, 1:47:08 PM7/10/18
to Jenkins Users
My organization is using the Kubernetes plugin for Jenkins and we have dozens of Jenkinsfile's floating across each project. We recently found a use case where we would like to have each podTemplate updated across all the Jenkinsfile

Is there anyway to automatically have all those podTemplates inherit some default/global values?

I was reading https://github.com/jenkinsci/kubernetes-plugin and the best thing I could find was the `inheritFrom` key that a podTemplate could have. This would require me to modify every Jenkinsfile though and I'm hoping to avoid that if possible.

If that's my best option where do I create the template? Is it set up in the Jenkins global configuration for the K8s plugin?

Thanks,
Asaf

Carlos Sanchez

unread,
Jul 10, 2018, 2:27:06 PM7/10/18
to Jenkins Users
you can setup a podtemplate as "default" in the global settings IIRC and all would inherit

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f0140e0c-762b-4067-875c-53145993c852%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Asaf Peleg

unread,
Jul 10, 2018, 5:38:26 PM7/10/18
to Jenkins Users

So as long as the template is named "default" it doesn't matter what the label of the podTemplates are?  I guess that in the "Usage" dropdown I would choose "use this node as much as possible" ? 


From: jenkins...@googlegroups.com <jenkins...@googlegroups.com> on behalf of Carlos Sanchez <car...@apache.org>
Sent: Tuesday, July 10, 2018 2:26:44 PM
To: Jenkins Users
Subject: Re: Kubernets Plugin: Automatically have podTemplate inherit global defaults
 
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/1jz786Tl7BM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6N2EC%3Dg1h6705tw3s_n6eD8nyzTVU5hGFQTS77a-2ECQA%40mail.gmail.com.

Carlos Sanchez

unread,
Jul 11, 2018, 3:57:02 AM7/11/18
to Jenkins Users
no, there is a field "Defaults Provider Template Name"
The name of the pod template to use for providing default values. When a value is specified and there is a pod template with a matching name, the template will be used as a parent to all other pod templates.

Reply all
Reply to author
Forward
0 new messages