Kubernetes plugin - multi clusters

30 views
Skip to first unread message

Tristan FAURE

unread,
Jan 17, 2019, 11:20:06 AM1/17/19
to jenkins...@googlegroups.com
Hello
The jenkins GUI allows the creation of several Kubernetes cloud, how does it work ?
Are they all used or only one ? If many is OK Is there a way to select a specific cluster in my pipeline ?

Thank you in advance

Tristan FAURE

Carlos Sanchez

unread,
Jan 17, 2019, 11:44:43 AM1/17/19
to Jenkins Users
all cloud definitions are used by matching the labels of the pod templates and your job labels



--
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/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Tristan FAURE

unread,
Jan 18, 2019, 3:02:07 AM1/18/19
to Jenkins Users
Thank you for your answer !

So If i have a k8s cloud cloud1 and another one cloud2 I can use the label to select one of them ?

In this sample (see bellow) I don't see where I have to insert the label ?
pipeline {
agent {
kubernetes {
label "bd-${random}"
yaml """
spec:
containers:
- name: node
image: node:8
command:
- cat
tty: true
"""
}
}

Carlos Sanchez

unread,
Jan 18, 2019, 3:21:03 AM1/18/19
to jenkins...@googlegroups.com

Tristan FAURE

unread,
Jan 18, 2019, 3:23:30 AM1/18/19
to jenkins...@googlegroups.com
Oops 🤐
Sorry I will test it. Thank you very much

You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/eBHsxw01nmo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PdB6a5S0qTogucnV2g7axfY%2Bi%2B-Y7Y_gpVz%2BCgh-cv7g%40mail.gmail.com.

pbasan...@gmail.com

unread,
Jan 22, 2019, 6:56:35 AM1/22/19
to Jenkins Users
on the Jenkin pipeline select the level and you can provide multiple lavels also . like cloud1 || cloud2 .. This will ensure job will execute on any of one the cloud and this will make sure job will execute on the active cluster if any one of the cluster is down/not active

Tristan FAURE

unread,
Jan 22, 2019, 7:58:30 AM1/22/19
to jenkins...@googlegroups.com
Thank you for your suggestion but I don't understand where I set the label ?

I tried this (not working) :
agent {
        kubernetes {
            cloud "cloud1 ||  cloud2"
            label "pod ID"
           
            yaml """
spec:
  containers:
  - name: docker

Carlos Sanchez

unread,
Jan 23, 2019, 5:50:34 AM1/23/19
to Jenkins Users
you have to choose cloud1 or cloud2 not "cloud1 || cloud2"
you can have multiple clouds, but need to decide which one to use when creating the pod template

Reply all
Reply to author
Forward
0 new messages