One Jenkins, Multiple Kubernetes Clusters

24 views
Skip to first unread message

Steve Garrett

unread,
Mar 6, 2019, 2:23:21 PM3/6/19
to Jenkins Users
Hi,

I'm trying to use multiple kubernetes clouds and have just a single jenkins I was able to get both kubernetes clusters registered as clouds and all the login checks work. When I run a build to the cluster where Jenkins is, i
t works fine, pulls code, builds an image and all that. However, when I change the label to my second cluster, that doesn't have any Jenkins there it seems to never want to build there and always builds on the cluster that's local to Jenkins.

I'm missing something stupid I'm sure of it but don't see what it is.


Thanks for your help


Steve

JR Cary

unread,
Mar 6, 2019, 2:29:37 PM3/6/19
to jenkins...@googlegroups.com
Our build system builds a number of packages.  When run in background,
locally,
we can gracefully stop after any current package build completes by
"touch stop.sys"
in the top directory.  (We prefer not to use Jenkins job cancelling
capabilities, as
it often leads the Windows server in a bad state, in need of reboot.)

Is there a way to accomplish this (graceful stop, send some sort of
signal) within Jenkins?

Thx....John Cary

Simon Richter

unread,
Mar 6, 2019, 2:34:08 PM3/6/19
to jenkins...@googlegroups.com
Hi,

On 06.03.19 20:29, JR Cary wrote:

> Is there a way to accomplish this (graceful stop, send some sort of
> signal) within Jenkins?

Jenkins has a "shutdown" state where it doesn't start any more builds,
which allows shutting down the server as soon as all jobs have finished.

It is also possible to mark agents as "offline", which will stop new
builds to be scheduled on them.

Both of these should be available via the API as well.

Simon

signature.asc

Carlos Sanchez

unread,
Mar 7, 2019, 4:42:24 AM3/7/19
to Jenkins Users
are you creating pod templates in UI or in pipeline?

in UI is just a matter of assigning different labels to different pod templates in different clouds
in pipeline you can pass an argument "cloud" to podTemplate

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/51ef6954-78a9-44cf-a4f0-0848fb0f5547%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Garrett

unread,
Mar 7, 2019, 12:44:13 PM3/7/19
to Jenkins Users

Hi,

in the podTemplate, I'm using scripted jenkinsfiles so does that still apply?  I've never seen a cloud parameter before.

Thanks,

Steve

Steve Garrett

unread,
Mar 7, 2019, 1:05:23 PM3/7/19
to jenkins...@googlegroups.com
Hi, was able to figure that out, thanks for your help there.  Now I get a different problem.  My pod gets created now on the right cluster but it seems to fail to pull the image.  When I go onto any of the worker nodes I'm able to do a docker pull and it works just fine.  What am I doing wrong?

Thanks

Steve


Liejun Tao

unread,
Mar 7, 2019, 2:32:37 PM3/7/19
to jenkins...@googlegroups.com
kubectl describe pod
would tell why the pod can't start.
If you are using private registry, "pull image secret" is required.
Sometimes a manual "docker logout" on the worker node help with image pull.


For more options, visit https://groups.google.com/d/optout.


--
Thanks,
Baibai

Steve Garrett

unread,
Mar 7, 2019, 3:32:57 PM3/7/19
to jenkins...@googlegroups.com
Yes, for me it was that the pod wasn't defined properly in the cloud configuration within Jenkins and all seems to be right.  I just need to expose the jnlp ports outside the cluster so the jnlp container can communicate with Jenkins in the other cluster.  Thanks for your help, appreciate it

Steve


Reply all
Reply to author
Forward
0 new messages