Skip to content

Instantly share code, notes, and snippets.

@jhoblitt
Created April 18, 2016 19:20
Show Gist options
  • Save jhoblitt/ce91b458526e3a03d365e2689db825f0 to your computer and use it in GitHub Desktop.
Save jhoblitt/ce91b458526e3a03d365e2689db825f0 to your computer and use it in GitHub Desktop.
configuring the kubernetes jenkins plugin via groovy
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()
@jhoblitt
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment