<p>Is there a groovy script out there to setup a kubernetes cloud config in jenkins?</p>

<p>I had one for mesos but have since moved to kubernetes.  I have multiple masters and would like to keep them all up to date with the active kubernetes cluster and current list of containers.</p>

<p>Found this</p>

<p><a href="https://gist.github.com/jhoblitt/ce91b458526e3a03d365e2689db825f0" rel="nofollow noreferrer">https://gist.github.com/jhoblitt/ce91b458526e3a03d365e2689db825f0</a></p>

<pre><code>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()
</code></pre>
