In this demo we will see Jenkins deployed into Kubernetes via Helm and have Jenkins Agents spin up automatically as Pods.
CURRENT ISSUE: at the moment NodeSelector for agent does not seem to be delivered to Kubernetes cluster correctly. Since our cluster is hybrid (Linux and Windows) in order to work around it now we need to turn of Windows nodes.
helm install --name jenkins stable/jenkins -f jenkins-values.yaml
Use this as pipeline definition
podTemplate(label: 'mypod') {
node('mypod') {
stage('Do something nice') {
sh 'echo something nice'
}
}
}
Build project in Jenkins and watch containers to spin up and down.
kubectl get pods -o wide -w