Created
April 18, 2016 19:20
-
-
Save jhoblitt/ce91b458526e3a03d365e2689db825f0 to your computer and use it in GitHub Desktop.
configuring the kubernetes jenkins plugin via groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.csanchez.jenkins.plugins.kubernetes.* | |
import jenkins.model.* | |
def j = Jenkins.getInstance() | |
def k = new KubernetesCloud( | |
'jenkins-test', | |
null, | |
'https://130.211.146.130', | |
'default', | |
'https://citest.lsst.codes/', | |
'10', 0, 0, 5 | |
) | |
k.setSkipTlsVerify(true) | |
k.setCredentialsId('ec5cf56b-71e9-4886-9f03-42934a399148') | |
def p = new PodTemplate('centos:6', null) | |
p.setName('centos6') | |
p.setLabel('centos6-docker') | |
p.setRemoteFs('/home/jenkins') | |
k.addTemplate(p) | |
p = new PodTemplate('lsstsqre/centos:7-docker', null) | |
p.setName('centos7') | |
p.setLabel('centos7-docker') | |
p.setRemoteFs('/home/jenkins') | |
k.addTemplate(p) | |
j.clouds.replace(k) | |
j.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is great, thanks for the public post!
I would love to now see how this script can be called at launch time (eg. the leader comes up, how do I now attach and launch this script to the leader), but I realize that's a totally different scope of work and investment than your quick work here.
Thanks again!