Skip to content

Instantly share code, notes, and snippets.

@technolo-g
Forked from jhoblitt/kubernetes.groovy
Created March 28, 2017 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technolo-g/ccbe0639667b18235e156294c9ae81d2 to your computer and use it in GitHub Desktop.
Save technolo-g/ccbe0639667b18235e156294c9ae81d2 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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment