working kubernetes cloud not available in multi-branch pipeline

885 views
Skip to first unread message

Gabe Nydick

unread,
Aug 28, 2018, 2:54:22 PM8/28/18
to jenkins...@googlegroups.com
I have a successfully configured kubernetes cluster that runs my build jobs. When I configure a multi-branch pipeline, the Kubernetes cluster section just has ' -- none -- '. The multi-branch pipeline still runs, but it has errors that are in a different topic email, so I'll keep that there, but instead of using the pod template that runs all of the freestyle jobs, this one uses some other template that I can't find, maybe it's a default in the plugin code.

Thanks

Carlos Sanchez

unread,
Aug 28, 2018, 3:54:11 PM8/28/18
to Jenkins Users
> When I configure a multi-branch pipeline, the Kubernetes cluster section

are you talking about the section that says "Allow pipeline support for the following restricted Kubernetes Clouds"
that's only for security restrictions

You have to check what labels do you have defined in your pod template config and what labels your job uses. Check the logs for more detailed info, see debugging section in the plugin readme


On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick <ga...@ridezum.com> wrote:
I have a successfully configured kubernetes cluster that runs my build jobs. When I configure a multi-branch pipeline, the Kubernetes cluster section just has ' -- none -- '. The multi-branch pipeline still runs, but it has errors that are in a different topic email, so I'll keep that there, but instead of using the pod template that runs all of the freestyle jobs, this one uses some other template that I can't find, maybe it's a default in the plugin code.

Thanks

--
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/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFpoS3XRUy1pt2FQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Gabe Nydick

unread,
Aug 28, 2018, 4:00:28 PM8/28/18
to jenkins...@googlegroups.com
Exactly that section. So I have to add labels to my multi-branch job to match the labels in the template?

On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez <car...@apache.org> wrote:
> When I configure a multi-branch pipeline, the Kubernetes cluster section

are you talking about the section that says "Allow pipeline support for the following restricted Kubernetes Clouds"
that's only for security restrictions

You have to check what labels do you have defined in your pod template config and what labels your job uses. Check the logs for more detailed info, see debugging section in the plugin readme


On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick <ga...@ridezum.com> wrote:
I have a successfully configured kubernetes cluster that runs my build jobs. When I configure a multi-branch pipeline, the Kubernetes cluster section just has ' -- none -- '. The multi-branch pipeline still runs, but it has errors that are in a different topic email, so I'll keep that there, but instead of using the pod template that runs all of the freestyle jobs, this one uses some other template that I can't find, maybe it's a default in the plugin code.

Thanks

--
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-users+unsubscribe@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKBfB5EYTp_egw%40mail.gmail.com.

Gabe Nydick

unread,
Aug 28, 2018, 4:01:27 PM8/28/18
to jenkins...@googlegroups.com
I don't see where I can add labels to my job.

Gabe Nydick

unread,
Aug 28, 2018, 4:02:05 PM8/28/18
to jenkins...@googlegroups.com
Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?

Carlos Sanchez

unread,
Aug 28, 2018, 4:10:34 PM8/28/18
to Jenkins Users
It depends on what are you trying to do which is not clear. If you are building a pipeline job you need to use

node(label) {}


On Tue, Aug 28, 2018 at 10:02 PM Gabe Nydick <ga...@ridezum.com> wrote:
Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?
On Tue, Aug 28, 2018 at 1:01 PM, Gabe Nydick <ga...@ridezum.com> wrote:
I don't see where I can add labels to my job.
On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick <ga...@ridezum.com> wrote:
Exactly that section. So I have to add labels to my multi-branch job to match the labels in the template?
On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez <car...@apache.org> wrote:
> When I configure a multi-branch pipeline, the Kubernetes cluster section

are you talking about the section that says "Allow pipeline support for the following restricted Kubernetes Clouds"
that's only for security restrictions

You have to check what labels do you have defined in your pod template config and what labels your job uses. Check the logs for more detailed info, see debugging section in the plugin readme


On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick <ga...@ridezum.com> wrote:
I have a successfully configured kubernetes cluster that runs my build jobs. When I configure a multi-branch pipeline, the Kubernetes cluster section just has ' -- none -- '. The multi-branch pipeline still runs, but it has errors that are in a different topic email, so I'll keep that there, but instead of using the pod template that runs all of the freestyle jobs, this one uses some other template that I can't find, maybe it's a default in the plugin code.

Thanks

--
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.

--
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.

--
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/CACTWNKBZ%2BaEVZL_JdpY8a%2B59m8MTBgWtMtVvQCsmFpT0r8y7Tg%40mail.gmail.com.

Gabe Nydick

unread,
Aug 28, 2018, 4:34:25 PM8/28/18
to jenkins...@googlegroups.com
OK, so this is what I have as a POC. I don't see why the pods i'm creating are called 'jenkins-slave' when the pod template i'm inheriting has the pods named 'jenkins-builder'

def label = "jenkins-builder-${UUID.randomUUID().toString()}"

podTemplate(label: label, inheritFrom: 'jenkins-builder', containers: [
containerTemplate(name: 'kubectl', image: '<redact>', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'helm', image: '<redact>', command: 'cat', ttyEnabled: true),
containerTemplate(name: 'jenkins-agent', image: '<redact>', command: 'cat', ttyEnabled: true)
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: '/var/run/docker.sock')
]) {
node(label) {
def myRepo = checkout scm
def gitCommit = myRepo.GIT_COMMIT
def gitBranch = myRepo.GIT_BRANCH
def shortGitCommit = "${gitCommit[0..10]}"
def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", returnStdout: true)

stage('Create Docker images') {
container('jenkins-agent') {
sh """
\$(aws ecr get-login --no-include-email --region=us-west-2 | sed 's/-e none//')
docker build -t <redact>:${gitCommit} . -f base.Dockerfile
docker push <redact>:${gitCommit}
"""
}
}
stage('Run kubectl') {
container('kubectl') {
sh "kubectl get pods"
}
}
stage('Run helm') {
container('helm') {
sh "helm list"
}
}
}
}


To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscribe@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PwNu7z523OTQCavSBne%2Bcpq1WQHwxRus-w-5J%3DKnCBpQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages