The Jenkins kubernetes plugin need to wait a long time about 15s before the salve build,why?

3/29/2017

I use the Jenkins kubernetes plugin to build a job, but when I start build I have to wait for about 15s before the slave is online. Why does this happen?

-- ladventure
jenkins
jenkins-plugins
kubernetes

2 Answers

11/23/2018

I had the same problem. I fixed this to a large extent by making sure that my master and slave images were in the Same region, subnet as well VPC. Moreover, I was fetching some config files from AWS S3 and moved the bucket to the same region as well.

All of this combined should make everything much quicker.

-- bholagabbar
Source: StackOverflow

3/30/2017

You need to be aware that when you use the Kubernetes Plugin, your Jenkins-slave is created on demand when you build a job. Supposing you are using the jnlp-slave as your jenkins-slave image, 15s is the time need for k8s to schedule the pod and to start up the jnlp slave jar.

What you can do in order to optimize the time, is using the option Time in minutes to retain slave when idle in the Kubernetes Plugin configuration, that holds the pods running for a determined amount of time, so the next builds can reuse that slave.

-- lucasvasconcelos
Source: StackOverflow