Re: Kubernetes Plugin - Running more than one agent of a pod template concurrently

2023-09-08 Thread 'jn...@cloudbees.com' via Jenkins Users


we notice that only a single agent pod is active at a time.
- First job is active, and create a pod successfully.
- Once a new parallel job triggers, it tries to use the same agent pod, and 
keep waiting for an executor t become avalable on same pod which first job 
is using
- Once first job completes, and the pod it was using gets terminated, then 
second job spawns a new agent pod


sounds like an issue in your pipeline, did you check / follow the docs esp 
wrt  podTemplate and POD_LABEL [1]

/James

[1] 
https://plugins.jenkins.io/kubernetes/#plugin-content-using-the-pipeline-step

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c06c4745-5993-4768-ae21-cd3cb58cn%40googlegroups.com.


Kubernetes Plugin - Running more than one agent of a pod template concurrently

2023-09-01 Thread Ashish Sharma
Dear All,

We are using kubernetes plugin to spawn new agents for build jobs.
We want to ensure that multiple agent pods are running for build stages 
(which take a while to run and complete).

However we notice that only a single agent pod is active at a time.
- First job is active, and create a pod successfully.
- Once a new parallel job triggers, it tries to use the same agent pod, and 
keep waiting for an executor t become avalable on same pod which first job 
is using
- Once first job completes, and the pod it was using gets terminated, then 
second job spawns a new agent pod

Can you please suggest what settings/configuration we would need to check 
in order to make this work?

Jenkins: 2.319.3
K8S plugin: 3580.x

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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6886e87f-825a-4b33-9f10-0c2e371cc9e8n%40googlegroups.com.


Kubernetes plugin. Identical pod template in multiple kube clouds.

2022-08-31 Thread ravi kiran rao bukka
hey i have a question about the kuberentes plugin in Jenkins. I see that it 
offers to add multiple clouds and pod templates. If i have two clouds 
(pointing to different kube clusters) and offering same pod templates. How 
does the plugin choose which cloud (kube cluster) to go with? If a kube 
cluster fails does it fail-over to the other one?

https://github.com/jenkinsci/kubernetes-plugin

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/98e7f2bd-97cf-406a-886b-c3f9d81c717en%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2022-04-13 Thread Ivan Fernandez Calvo
Another solution that does not impact your pipelines, is to use a DinD 
container and export DOCKER_HOST in all the containers of the pod, this 
allows access to Docker to all containers using the docker CLI

pipeline {
  agent {
  kubernetes {
defaultContainer 'docker-cli'
yaml '''
  apiVersion: v1
  kind: Pod
  spec:
imagePullSecrets:
  - name: 'repo.example.com'
  - name: 'repo1.example.com'
containers:
  - name: dind
image: docker:20.10.12-dind
securityContext:
  privileged: true
env:
  - name: DOCKER_TLS_CERTDIR
value: ""
command:
  - dockerd
args:
  - -H tcp://localhost:2375
  --H unix:///var/run/docker.sock
ports:
  - containerPort: 2375
hostIP: 127.0.0.1
volumeMounts:
  - name: docker-cache
mountPath: /var/lib/docker
  - name: docker-cli
image: my-docker-cli-container:latest
command:
  - sleep
args:
  - infinity
env:
  - name: DOCKER_HOST
value: tcp://localhost:2375
volumes:
  - name: docker-cache
emptyDir: {}
'''
}
}


El miércoles, 13 de abril de 2022 a las 1:21:17 UTC+2, janmont...@gmail.com 
escribió:

> For builds that need docker, we have used docker:dind in the past. So we 
> have a maven build running in a maven container in a pod, and that build 
> uses dind to run testcontainers. 
>
> I wonder if something like that would work for your use case?
>
> Here’s more info on dind: 
>
> http://blog.teracy.com/2017/09/11/how-to-use-docker-in-docker-dind-and-docker-outside-of-docker-dood-for-local-ci-testing/
>
> On Wed, Sep 29, 2021 at 19:05 'Mario Rodriguez' via Jenkins Users <
> jenkins...@googlegroups.com> wrote:
>
>> Hello, Kubernetes project is planning to deprecate support for dockershim 
>> runtime is version 1.20 and fully drop it in version 1.24 as indicated 
>> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>
>>  
>>
>> Reading about the impacts of dockershim removal here:  
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>   and 
>> here 
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>  ,  any 
>> apps that depend on the docker daemon by exposing /var/run/docker.sock will 
>> be impacted.  We use the Kubernetes plugin for Jenkins 
>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon 
>> exposure technique.
>>
>>
>> Assuming a transition from docker to containerd, any idea what changes 
>> will be needed by Kubernetes plugin users to continue working properly ?
>>
>>
>> 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/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0d79c6f8-a868-41d7-854f-0350edf67db8n%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2022-04-12 Thread Jan Monterrubio
For builds that need docker, we have used docker:dind in the past. So we
have a maven build running in a maven container in a pod, and that build
uses dind to run testcontainers.

I wonder if something like that would work for your use case?

Here’s more info on dind:
http://blog.teracy.com/2017/09/11/how-to-use-docker-in-docker-dind-and-docker-outside-of-docker-dood-for-local-ci-testing/

On Wed, Sep 29, 2021 at 19:05 'Mario Rodriguez' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hello, Kubernetes project is planning to deprecate support for dockershim
> runtime is version 1.20 and fully drop it in version 1.24 as indicated
> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>
>
>
> Reading about the impacts of dockershim removal here:
> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>   and
> here
> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>  ,  any
> apps that depend on the docker daemon by exposing /var/run/docker.sock will
> be impacted.  We use the Kubernetes plugin for Jenkins
> <https://plugins.jenkins.io/kubernetes/> using this docker daemon
> exposure technique.
>
>
> Assuming a transition from docker to containerd, any idea what changes
> will be needed by Kubernetes plugin users to continue working properly ?
>
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2022-04-12 Thread 'Mario Rodriguez' via Jenkins Users
Hi, yes, I was able to replace docker tooling with a combination of kaniko 
and podman.  Kaniko will build the OCI container images in a daemonless 
fashion and podman will let you run other commands such as tag, pull, push. 
 Please be aware kaniko 1.7.0 has issues with workload identity 
authentication and 1.8.0 has issues with public gcr.io repositories, then 
1.6.0 is the latest stable version that works fine under broader conditions.

I hope it helps

On Tuesday, April 12, 2022 at 4:14:12 AM UTC-6 sri...@ftdi.com wrote:

> We are faced with the same issue for our Jenkins implementation. 
> cr...@llbean.com I wonder if you were able to utilize Kaniko or if you 
> found another alternative that worked for you? Any further insight is 
> appreciated!
>
> On Wednesday, October 27, 2021 at 1:15:29 PM UTC-6 car...@apache.org 
> wrote:
>
>> You cannot use the docker.sock anymore
>>
>> On Wed, Oct 27, 2021 at 5:00 AM 'Mario Rodriguez' via Jenkins Users <
>> jenkins...@googlegroups.com> wrote:
>>
>>> and how about if we are using the kubernetes plugin podTemplate 
>>> <https://www.jenkins.io/doc/pipeline/steps/kubernetes/#podtemplate-define-a-podtemplate-to-use-in-the-kubernetes-plugin>
>>>  
>>> ?  more less like this:
>>>
>>> podTemplate(cloud: 'kubernetes', label: args.pipelineName,
>>> containers: getContainers(...),
>>> volumes: [
>>> hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: 
>>> '/var/run/docker.sock'),
>>> ])  {
>>>gcloud auth configure-docker --account=
>>> jen...@myproject.iam.gserviceaccount.com
>>>docker build --pull -t ${env.btvImageFullName} -t 
>>> ${env.btvLatestFullName} . 
>>> }
>>>
>>> On Thursday, September 30, 2021 at 1:32:06 AM UTC-6 car...@apache.org 
>>> wrote:
>>>
>>>> You can use a different builder like Kaniko with the plugin
>>>>
>>>>
>>>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko-declarative.groovy
>>>>
>>>>
>>>> On Thu, Sep 30, 2021 at 2:05 AM 'Mario Rodriguez' via Jenkins Users <
>>>> jenkins...@googlegroups.com> wrote:
>>>>
>>>>> Hello, Kubernetes project is planning to deprecate support for 
>>>>> dockershim runtime is version 1.20 and fully drop it in version 1.24 as 
>>>>> indicated here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>>>>
>>>>>  
>>>>>
>>>>> Reading about the impacts of dockershim removal here:  
>>>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>>>>   and 
>>>>> here 
>>>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>>>>  ,  any 
>>>>> apps that depend on the docker daemon by exposing /var/run/docker.sock 
>>>>> will 
>>>>> be impacted.  We use the Kubernetes plugin for Jenkins 
>>>>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon 
>>>>> exposure technique.
>>>>>
>>>>>
>>>>> Assuming a transition from docker to containerd, any idea what changes 
>>>>> will be needed by Kubernetes plugin users to continue working properly ?
>>>>>
>>>>>
>>>>> 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/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> 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/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a266480f-d623-4d72-9f56-98bf7f3545dan%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2022-04-12 Thread Steve Ridley
We are faced with the same issue for our Jenkins implementation. 
cr...@llbean.com I wonder if you were able to utilize Kaniko or if you 
found another alternative that worked for you? Any further insight is 
appreciated!

On Wednesday, October 27, 2021 at 1:15:29 PM UTC-6 car...@apache.org wrote:

> You cannot use the docker.sock anymore
>
> On Wed, Oct 27, 2021 at 5:00 AM 'Mario Rodriguez' via Jenkins Users <
> jenkins...@googlegroups.com> wrote:
>
>> and how about if we are using the kubernetes plugin podTemplate 
>> <https://www.jenkins.io/doc/pipeline/steps/kubernetes/#podtemplate-define-a-podtemplate-to-use-in-the-kubernetes-plugin>
>>  
>> ?  more less like this:
>>
>> podTemplate(cloud: 'kubernetes', label: args.pipelineName,
>> containers: getContainers(...),
>> volumes: [
>> hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: 
>> '/var/run/docker.sock'),
>> ])  {
>>gcloud auth configure-docker --account=
>> jen...@myproject.iam.gserviceaccount.com
>>docker build --pull -t ${env.btvImageFullName} -t 
>> ${env.btvLatestFullName} . 
>> }
>>
>> On Thursday, September 30, 2021 at 1:32:06 AM UTC-6 car...@apache.org 
>> wrote:
>>
>>> You can use a different builder like Kaniko with the plugin
>>>
>>>
>>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko-declarative.groovy
>>>
>>>
>>> On Thu, Sep 30, 2021 at 2:05 AM 'Mario Rodriguez' via Jenkins Users <
>>> jenkins...@googlegroups.com> wrote:
>>>
>>>> Hello, Kubernetes project is planning to deprecate support for 
>>>> dockershim runtime is version 1.20 and fully drop it in version 1.24 as 
>>>> indicated here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>>>
>>>>  
>>>>
>>>> Reading about the impacts of dockershim removal here:  
>>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>>>   and 
>>>> here 
>>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>>>  ,  any 
>>>> apps that depend on the docker daemon by exposing /var/run/docker.sock 
>>>> will 
>>>> be impacted.  We use the Kubernetes plugin for Jenkins 
>>>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon 
>>>> exposure technique.
>>>>
>>>>
>>>> Assuming a transition from docker to containerd, any idea what changes 
>>>> will be needed by Kubernetes plugin users to continue working properly ?
>>>>
>>>>
>>>> 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/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> -- 
>> 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/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/aa79afa1-de1a-4bcc-94f9-7f8ab62d730bn%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2021-10-27 Thread Carlos Sanchez
You cannot use the docker.sock anymore

On Wed, Oct 27, 2021 at 5:00 AM 'Mario Rodriguez' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> and how about if we are using the kubernetes plugin podTemplate
> <https://www.jenkins.io/doc/pipeline/steps/kubernetes/#podtemplate-define-a-podtemplate-to-use-in-the-kubernetes-plugin>
> ?  more less like this:
>
> podTemplate(cloud: 'kubernetes', label: args.pipelineName,
> containers: getContainers(...),
> volumes: [
> hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
> '/var/run/docker.sock'),
> ])  {
>gcloud auth configure-docker --account=
> jenk...@myproject.iam.gserviceaccount.com
>docker build --pull -t ${env.btvImageFullName} -t
> ${env.btvLatestFullName} .
> }
>
> On Thursday, September 30, 2021 at 1:32:06 AM UTC-6 car...@apache.org
> wrote:
>
>> You can use a different builder like Kaniko with the plugin
>>
>>
>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko-declarative.groovy
>>
>>
>> On Thu, Sep 30, 2021 at 2:05 AM 'Mario Rodriguez' via Jenkins Users <
>> jenkins...@googlegroups.com> wrote:
>>
>>> Hello, Kubernetes project is planning to deprecate support for
>>> dockershim runtime is version 1.20 and fully drop it in version 1.24 as
>>> indicated here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>>
>>>
>>>
>>> Reading about the impacts of dockershim removal here:
>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>>   and
>>> here
>>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>>  ,  any
>>> apps that depend on the docker daemon by exposing /var/run/docker.sock will
>>> be impacted.  We use the Kubernetes plugin for Jenkins
>>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon
>>> exposure technique.
>>>
>>>
>>> Assuming a transition from docker to containerd, any idea what changes
>>> will be needed by Kubernetes plugin users to continue working properly ?
>>>
>>>
>>> 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/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6M1RSsy%3D1-Xhwk_YocX-1kMASY03x5Uuvgpa1qG%3DYOhhQ%40mail.gmail.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2021-10-26 Thread 'Mario Rodriguez' via Jenkins Users
and how about if we are using the kubernetes plugin podTemplate 
<https://www.jenkins.io/doc/pipeline/steps/kubernetes/#podtemplate-define-a-podtemplate-to-use-in-the-kubernetes-plugin>
 
?  more less like this:

podTemplate(cloud: 'kubernetes', label: args.pipelineName,
containers: getContainers(...),
volumes: [
hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: 
'/var/run/docker.sock'),
])  {
   gcloud auth configure-docker 
--account=jenk...@myproject.iam.gserviceaccount.com
   docker build --pull -t ${env.btvImageFullName} -t 
${env.btvLatestFullName} . 
}

On Thursday, September 30, 2021 at 1:32:06 AM UTC-6 car...@apache.org wrote:

> You can use a different builder like Kaniko with the plugin
>
>
> https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko-declarative.groovy
>
>
> On Thu, Sep 30, 2021 at 2:05 AM 'Mario Rodriguez' via Jenkins Users <
> jenkins...@googlegroups.com> wrote:
>
>> Hello, Kubernetes project is planning to deprecate support for dockershim 
>> runtime is version 1.20 and fully drop it in version 1.24 as indicated 
>> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>
>>  
>>
>> Reading about the impacts of dockershim removal here:  
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>   and 
>> here 
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>  ,  any 
>> apps that depend on the docker daemon by exposing /var/run/docker.sock will 
>> be impacted.  We use the Kubernetes plugin for Jenkins 
>> <https://plugins.jenkins.io/kubernetes/> using this docker daemon 
>> exposure technique.
>>
>>
>> Assuming a transition from docker to containerd, any idea what changes 
>> will be needed by Kubernetes plugin users to continue working properly ?
>>
>>
>> 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/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1e0e5ccf-5983-4ac3-a806-e23a2801f89en%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2021-09-30 Thread Carlos Sanchez
You can use a different builder like Kaniko with the plugin

https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/kaniko-declarative.groovy


On Thu, Sep 30, 2021 at 2:05 AM 'Mario Rodriguez' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hello, Kubernetes project is planning to deprecate support for dockershim
> runtime is version 1.20 and fully drop it in version 1.24 as indicated
> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>
>
>
> Reading about the impacts of dockershim removal here:
> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>   and
> here
> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>  ,  any
> apps that depend on the docker daemon by exposing /var/run/docker.sock will
> be impacted.  We use the Kubernetes plugin for Jenkins
> <https://plugins.jenkins.io/kubernetes/> using this docker daemon
> exposure technique.
>
>
> Assuming a transition from docker to containerd, any idea what changes
> will be needed by Kubernetes plugin users to continue working properly ?
>
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

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


Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2021-09-29 Thread 'Mario Rodriguez' via Jenkins Users


Hello, Kubernetes project is planning to deprecate support for dockershim 
runtime is version 1.20 and fully drop it in version 1.24 as indicated 
here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/

 

Reading about the impacts of dockershim removal here:  
https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
  and 
here 
https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
 ,  any 
apps that depend on the docker daemon by exposing /var/run/docker.sock will 
be impacted.  We use the Kubernetes plugin for Jenkins 
<https://plugins.jenkins.io/kubernetes/> using this docker daemon exposure 
technique.


Assuming a transition from docker to containerd, any idea what changes will 
be needed by Kubernetes plugin users to continue working properly ?


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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com.


Re: Kubernetes plugin

2021-03-22 Thread Richard Bywater
Ah right gotcha. That makes me feel a little more at ease.

Thanks!
Richard

On Tue, 23 Mar 2021, 3:04 am Carlos Sanchez,  wrote:

> I think Guillermo confused the plugin referenced, as he was maintainer of
> the kubernetes-ci-plugin, which I guess is the one no longer maintained.
>
>
> On Mon, Mar 22, 2021 at 9:28 AM Richard Bywater 
> wrote:
>
>> Hi
>>
>> I was just looking at JENKINS-64778
>> <https://issues.jenkins.io/browse/JENKINS-64778> which regarded a
>> request in the Kubernetes plugin and noted one of the comments was "we are
>> no longer actively maintaining this plugin"
>>
>> Just wondering about whether this is because there is another plugin that
>> is now instead favoured to be used or was that just a comment about the one
>> particular maintainer but the plugin itself is still being maintained?
>>
>> We are just starting to implement a solution that will be using the
>> Kubernetes plugin so if it's going to break in the near future would be
>> good to know :)
>>
>> Thanks
>> Richard.
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CAAy0hweadzZP-7_VQuhZteYz2pt6HOVhmEH0OMgGnTJdkoO%3Djg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAAy0hweadzZP-7_VQuhZteYz2pt6HOVhmEH0OMgGnTJdkoO%3Djg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6O4wEUPKP16KOoNq3SSnga3Aa0mLVYGApTsf_Gap%2B69-A%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6O4wEUPKP16KOoNq3SSnga3Aa0mLVYGApTsf_Gap%2B69-A%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

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


Re: Kubernetes plugin

2021-03-22 Thread Carlos Sanchez
I think Guillermo confused the plugin referenced, as he was maintainer of
the kubernetes-ci-plugin, which I guess is the one no longer maintained.


On Mon, Mar 22, 2021 at 9:28 AM Richard Bywater  wrote:

> Hi
>
> I was just looking at JENKINS-64778
> <https://issues.jenkins.io/browse/JENKINS-64778> which regarded a request
> in the Kubernetes plugin and noted one of the comments was "we are no
> longer actively maintaining this plugin"
>
> Just wondering about whether this is because there is another plugin that
> is now instead favoured to be used or was that just a comment about the one
> particular maintainer but the plugin itself is still being maintained?
>
> We are just starting to implement a solution that will be using the
> Kubernetes plugin so if it's going to break in the near future would be
> good to know :)
>
> Thanks
> Richard.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAAy0hweadzZP-7_VQuhZteYz2pt6HOVhmEH0OMgGnTJdkoO%3Djg%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAAy0hweadzZP-7_VQuhZteYz2pt6HOVhmEH0OMgGnTJdkoO%3Djg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

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


Kubernetes plugin

2021-03-22 Thread Richard Bywater
Hi

I was just looking at JENKINS-64778
<https://issues.jenkins.io/browse/JENKINS-64778> which regarded a request
in the Kubernetes plugin and noted one of the comments was "we are no
longer actively maintaining this plugin"

Just wondering about whether this is because there is another plugin that
is now instead favoured to be used or was that just a comment about the one
particular maintainer but the plugin itself is still being maintained?

We are just starting to implement a solution that will be using the
Kubernetes plugin so if it's going to break in the near future would be
good to know :)

Thanks
Richard.

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


kubernetes plugin: How can i let the build to stop when pulling image failed?

2020-11-22 Thread Hyunil Shin
Hi all

I have question about kubernetes plugin.
when wrong data is provided, pulling image failed.
error message: denied: requested access to the resource is denied
For example, wrong image name is given, it failed.

But there may be no timeout, so the build is not finished. At the time, I 
should cancel the build.
How can i let the build to stop?

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ff7af2b1-885a-441d-a136-69bf9177f3dfn%40googlegroups.com.


Re: [Kubernetes Plugin] PVC for each build agent with defined size.

2020-11-22 Thread Liejun Tao
It should be doable by extending this: Dynamic Jenkins Agent from Kubernetes


On Sat, Nov 21, 2020 at 6:49 AM Nadir Mouhoubi  wrote:

> Hello,
>
> I'm looking for a simple solution without implementing a mutating K8S
> Webhook that allow me to use a dynamic provisioned PVC for each agent pod
> without fixing the PVC size at Jenkins cloud definition for the workspace.
>
> Is there a way to get this working.
>
> Thanks.
>
> Nadir.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/a5a5f0de-9818-48bd-b1ad-59e21fe75792n%40googlegroups.com
> 
> .
>


-- 
Thanks,
Baibai

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


[Kubernetes Plugin] PVC for each build agent with defined size.

2020-11-21 Thread Nadir Mouhoubi
Hello,

I'm looking for a simple solution without implementing a mutating K8S 
Webhook that allow me to use a dynamic provisioned PVC for each agent pod 
without fixing the PVC size at Jenkins cloud definition for the workspace.

Is there a way to get this working.

Thanks.

Nadir.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a5a5f0de-9818-48bd-b1ad-59e21fe75792n%40googlegroups.com.


Re: Kubernetes plugin - container is not valid for pod

2020-10-01 Thread Michael Kanchuker‎
Thank you very much, It works now.
I didn't know pod template inheritance was a thing.

Michael.


On Friday, September 25, 2020 at 5:35:49 PM UTC+3 Vincent Latombe wrote:

> Try changing your Jenkinsfile to:
>
> podTemplate(
> containers: [
> containerTemplate(name: 'docker', image: 'docker:19.03', 
> ttyEnabled: true, command: 'cat'),
> containerTemplate(name: 'nodejs', image: 'node:12-buster', 
> ttyEnabled: true, command: 'cat')
> ],
> volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: 
> '/var/run/docker.sock')]
> )
> {
> node(POD_LABEL) {
>
> stage('Checkout') {
> checkout scm
> container('nodejs') {
> ...
>
>
> Vincent
>
>
> Le lun. 21 sept. 2020 à 17:19, Michael Kanchuker‎  
> a écrit :
>
>> Hi,
>>
>> Lately I began getting a repeating error in one of my builds: Exec 
>> Failure: HTTP:400. Message:container nodejs is not valid for pod 
>> admin-builder-d5gwq-ftgs2.
>> This is a job in a multibranch pipeline running from a Jenkins file (see 
>> below). I can see the container in kubectl, and I can run a shell in it.
>> I don't experience this in my other builds.
>> I'm running Jenkins v2.249.1 and Kubernetes plugin v1.27.1.
>>
>> Your help is much appreciated,
>> Michael Kanchuker.
>>
>> Jenkinsfile:
>> podTemplate(label: "admin-builder",
>> containers: [
>> containerTemplate(name: 'docker', image: 'docker:19.03', 
>> ttyEnabled: true, command: 'cat'),
>> containerTemplate(name: 'nodejs', image: 'node:12-buster', 
>> ttyEnabled: true, command: 'cat')
>> ],
>> volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: 
>> '/var/run/docker.sock')]
>> )
>> {
>> node("admin-builder") {
>> stage('Checkout') {
>> checkout scm
>> container('nodejs') {
>>
>> Jenkins Log:
>>
>> Sep 17, 2020 2:56:17 PM SEVERE 
>> io.fabric8.kubernetes.client.dsl.internal.ExecWebSocketListener onFailure
>>
>> Exec Failure: HTTP:400. Message:container nodejs is not valid for pod 
>> admin-builder-d5gwq-ftgs2
>> java.net.ProtocolException: Expected HTTP 101 response but was '400 Bad 
>> Request'
>>  at 
>> okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:229)
>>  at 
>> okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:196)
>>  at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
>>  at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  at java.lang.Thread.run(Thread.java:748)
>>
>>
>> Sep 17, 2020 2:56:17 PM WARNING jenkins.security.ClassFilterImpl 
>> notifyRejected
>>
>> io.fabric8.kubernetes.api.model.Status in 
>> file:/var/jenkins_home/plugins/kubernetes-client-api/WEB-INF/lib/kubernetes-model-core-4.11.1.jar
>>  might be dangerous, so rejecting; see 
>> https://jenkins.io/redirect/class-filter/
>>
>> Sep 17, 2020 2:56:17 PM INFO 
>> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
>>
>> Terminating Kubernetes instance for agent admin-builder-d5gwq-ftgs2
>>
>> Sep 17, 2020 2:56:17 PM INFO 
>> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod
>>
>> Terminated Kubernetes instance for agent jenkins/admin-builder-d5gwq-ftgs2
>>
>> Sep 17, 2020 2:56:17 PM INFO 
>> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
>>
>> Disconnected computer admin-builder-d5gwq-ftgs2
>>
>> Sep 17, 2020 2:56:17 PM INFO jenkins.slaves.DefaultJnlpSlaveReceiver 
>> channelClosed
>>
>> Computer.threadPoolForRemoting [#14] for admin-builder-d5gwq-ftgs2 
>> terminated: java.nio.channels.ClosedChannelException
>>
>> Sep 17, 2020 2:56:17 PM INFO hudson.remoting.Request$2 run
>>
>> Failed to send back a reply to the request 
>> hudson.remoting.Request$2@21eb663a: hudson.remoting.ChannelClosedException: 
>> Channel "hudson.remoting.Channel@2c296147:JNLP4-connect connection from 
>> 10.42.7.220/10.42.7.220:36320": channel is already closed
>>
>> Sep 17, 2020 2:56:18 PM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun 
>> finish
>>
>> WB-Services/Admin/jenkins_test #14 completed: FAILURE
>>
>> -- 
>> You received th

Re: Kubernetes plugin - container is not valid for pod

2020-09-25 Thread Vincent Latombe
Try changing your Jenkinsfile to:

podTemplate(
containers: [
containerTemplate(name: 'docker', image: 'docker:19.03',
ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'nodejs', image: 'node:12-buster',
ttyEnabled: true, command: 'cat')
],
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
'/var/run/docker.sock')]
)
{
node(POD_LABEL) {
stage('Checkout') {
checkout scm
container('nodejs') {
...


Vincent


Le lun. 21 sept. 2020 à 17:19, Michael Kanchuker‎ <
michaelkanchu...@gmail.com> a écrit :

> Hi,
>
> Lately I began getting a repeating error in one of my builds: Exec
> Failure: HTTP:400. Message:container nodejs is not valid for pod
> admin-builder-d5gwq-ftgs2.
> This is a job in a multibranch pipeline running from a Jenkins file (see
> below). I can see the container in kubectl, and I can run a shell in it.
> I don't experience this in my other builds.
> I'm running Jenkins v2.249.1 and Kubernetes plugin v1.27.1.
>
> Your help is much appreciated,
> Michael Kanchuker.
>
> Jenkinsfile:
> podTemplate(label: "admin-builder",
> containers: [
> containerTemplate(name: 'docker', image: 'docker:19.03',
> ttyEnabled: true, command: 'cat'),
> containerTemplate(name: 'nodejs', image: 'node:12-buster',
> ttyEnabled: true, command: 'cat')
> ],
> volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
> '/var/run/docker.sock')]
> )
> {
> node("admin-builder") {
> stage('Checkout') {
> checkout scm
> container('nodejs') {
>
> Jenkins Log:
>
> Sep 17, 2020 2:56:17 PM SEVERE 
> io.fabric8.kubernetes.client.dsl.internal.ExecWebSocketListener onFailure
>
> Exec Failure: HTTP:400. Message:container nodejs is not valid for pod 
> admin-builder-d5gwq-ftgs2
> java.net.ProtocolException: Expected HTTP 101 response but was '400 Bad 
> Request'
>   at 
> okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:229)
>   at 
> okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:196)
>   at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
>   at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
>
>
> Sep 17, 2020 2:56:17 PM WARNING jenkins.security.ClassFilterImpl 
> notifyRejected
>
> io.fabric8.kubernetes.api.model.Status in 
> file:/var/jenkins_home/plugins/kubernetes-client-api/WEB-INF/lib/kubernetes-model-core-4.11.1.jar
>  might be dangerous, so rejecting; see 
> https://jenkins.io/redirect/class-filter/
>
> Sep 17, 2020 2:56:17 PM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
>
> Terminating Kubernetes instance for agent admin-builder-d5gwq-ftgs2
>
> Sep 17, 2020 2:56:17 PM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod
>
> Terminated Kubernetes instance for agent jenkins/admin-builder-d5gwq-ftgs2
>
> Sep 17, 2020 2:56:17 PM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
>
> Disconnected computer admin-builder-d5gwq-ftgs2
>
> Sep 17, 2020 2:56:17 PM INFO jenkins.slaves.DefaultJnlpSlaveReceiver 
> channelClosed
>
> Computer.threadPoolForRemoting [#14] for admin-builder-d5gwq-ftgs2 
> terminated: java.nio.channels.ClosedChannelException
>
> Sep 17, 2020 2:56:17 PM INFO hudson.remoting.Request$2 run
>
> Failed to send back a reply to the request 
> hudson.remoting.Request$2@21eb663a: hudson.remoting.ChannelClosedException: 
> Channel "hudson.remoting.Channel@2c296147:JNLP4-connect connection from 
> 10.42.7.220/10.42.7.220:36320": channel is already closed
>
> Sep 17, 2020 2:56:18 PM INFO org.jenkinsci.plugins.workflow.job.WorkflowRun 
> finish
>
> WB-Services/Admin/jenkins_test #14 completed: FAILURE
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAKdjnp3ZOiEfsLP570txYx6fxOrhi_3AJJBo8gd5z97XFGgOUw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAKdjnp3ZOiEfsLP570txYx6fxOrhi_3AJJBo8gd5z97XFGgOUw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

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


Kubernetes plugin - container is not valid for pod

2020-09-21 Thread Michael Kanchuker‎
Hi,

Lately I began getting a repeating error in one of my builds: Exec Failure:
HTTP:400. Message:container nodejs is not valid for pod
admin-builder-d5gwq-ftgs2.
This is a job in a multibranch pipeline running from a Jenkins file (see
below). I can see the container in kubectl, and I can run a shell in it.
I don't experience this in my other builds.
I'm running Jenkins v2.249.1 and Kubernetes plugin v1.27.1.

Your help is much appreciated,
Michael Kanchuker.

Jenkinsfile:
podTemplate(label: "admin-builder",
containers: [
containerTemplate(name: 'docker', image: 'docker:19.03',
ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'nodejs', image: 'node:12-buster',
ttyEnabled: true, command: 'cat')
],
volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
'/var/run/docker.sock')]
)
{
node("admin-builder") {
stage('Checkout') {
checkout scm
container('nodejs') {

Jenkins Log:

Sep 17, 2020 2:56:17 PM SEVERE
io.fabric8.kubernetes.client.dsl.internal.ExecWebSocketListener
onFailure

Exec Failure: HTTP:400. Message:container nodejs is not valid for pod
admin-builder-d5gwq-ftgs2
java.net.ProtocolException: Expected HTTP 101 response but was '400 Bad Request'
at 
okhttp3.internal.ws.RealWebSocket.checkResponse(RealWebSocket.java:229)
at 
okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:196)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)


Sep 17, 2020 2:56:17 PM WARNING jenkins.security.ClassFilterImpl notifyRejected

io.fabric8.kubernetes.api.model.Status in
file:/var/jenkins_home/plugins/kubernetes-client-api/WEB-INF/lib/kubernetes-model-core-4.11.1.jar
might be dangerous, so rejecting; see
https://jenkins.io/redirect/class-filter/

Sep 17, 2020 2:56:17 PM INFO
org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate

Terminating Kubernetes instance for agent admin-builder-d5gwq-ftgs2

Sep 17, 2020 2:56:17 PM INFO
org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod

Terminated Kubernetes instance for agent jenkins/admin-builder-d5gwq-ftgs2

Sep 17, 2020 2:56:17 PM INFO
org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate

Disconnected computer admin-builder-d5gwq-ftgs2

Sep 17, 2020 2:56:17 PM INFO jenkins.slaves.DefaultJnlpSlaveReceiver
channelClosed

Computer.threadPoolForRemoting [#14] for admin-builder-d5gwq-ftgs2
terminated: java.nio.channels.ClosedChannelException

Sep 17, 2020 2:56:17 PM INFO hudson.remoting.Request$2 run

Failed to send back a reply to the request
hudson.remoting.Request$2@21eb663a:
hudson.remoting.ChannelClosedException: Channel
"hudson.remoting.Channel@2c296147:JNLP4-connect connection from
10.42.7.220/10.42.7.220:36320": channel is already closed

Sep 17, 2020 2:56:18 PM INFO
org.jenkinsci.plugins.workflow.job.WorkflowRun finish

WB-Services/Admin/jenkins_test #14 completed: FAILURE

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


Re: Kubernetes Plugin: How to run commands within agent container as non-root?

2020-09-15 Thread Vincent Latombe
Your second image runs as root and its /etc/passwd matches what you were
seeing in your pipeline.

➭ docker run --entrypoint /bin/bash -ti kasproject/kas
root@ffa3dff671f9:/# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System
(admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin



Vincent


Le mar. 15 sept. 2020 à 10:49, iris Jasper Orschulko <
jasper.orschu...@irisgmbh.de> a écrit :

> Hi Vincent,
>
> I am fairly certain, that the images are identical, as I used to pod image
> from the jenkins logs (jenkins/inbound-agent:4.3-4). The second image I
> used in the pipeline for the build process was
> https://hub.docker.com/r/kasproject/kas which also should have a non-root
> user (builder, uid 3). I am not sure how Jenkins handles the
> containerisation, but unless there is some magic in the background I do not
> understand, it should be one of those images.
>
> Best regards
>
> Mit freundlichen Grüßen
>
> Jasper Orschulko
> Build- und Configurationsmanager
>
> Tel. +49 30 58 58 14 265
> Fax +49 30 58 58 14 999
> jasper.orschu...@irisgmbh.de
>
> • • • • • • • • • • • • • • • • • • • • • • • • • •
>
> iris-GmbH
> infrared & intelligent sensors
> Ostendstraße 1-14 | 12459 Berlin
>
> Geschäftsführer
> M.-O. Brammann | R. Bönick | A. Thun
> Amtsgericht Berlin-Charlottenburg
> HRB 41 448 | USt-ID-Nr. DE 137228225
>
> www.irisgmbh.de
>
>
> --
> *From:* jenkinsci-users@googlegroups.com [jenkinsci-users@googlegroups.com]
> on behalf of Vincent Latombe [vincent.lato...@gmail.com]
> *Sent:* Friday, September 11, 2020 11:50 AM
> *To:* Jenkins Users
> *Subject:* Re: Kubernetes Plugin: How to run commands within agent
> container as non-root?
>
> > [Pipeline] container
>
> What is your container definition? I really doubt it is the same image as
> what you're running through docker CLI.
>
> Vincent
>
>
> Le jeu. 10 sept. 2020 à 19:59, iris Jasper Orschulko <
> jasper.orschu...@irisgmbh.de> a écrit :
>
>> I am trying to run a Pipeline in a Kubernetes agent, which needs to
>> execute commands as non-root user. So I tried setting the securityContext
>> of the Pod to 1000 (the default jenkins user) as described here:
>> https://plugins.jenkins.io/kubernetes/. However, the user does not exist
>> in the container within Kubernetes:
>>
>> [Pipeline] {
>> [Pipeline] stage
>> [Pipeline] { (Yocto Build)
>> [Pipeline] container
>> [Pipeline] {
>> [Pipeline] script
>> [Pipeline] {
>> [Pipeline] sh
>>
>> + set -ex
>> + cat /etc/passwd
>> root:x:0:0:root:/root:/bin/bash
>> daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
>> bin:x:2:2:bin:/bin:/usr/sbin/nologin
>> sys:x:3:3:sys:/dev:/usr/sbin/nologin
>> sync:x:4:65534:sync:/bin:/bin/sync
>> games:x:5:60:games:/usr/games:/usr/sbin/nologin
>> man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
>> lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
>> mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
>> news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
>> uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
>> proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
>> www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
>> backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
>> list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
>> irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
>> gnats:x:41:41:Gnats Bug-Reporting System
>> (admin):/var/lib/gnats:/usr/sbin/nologin
>> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
>> _apt:x:100:65534::/nonexistent:/usr/sbin/nologin
>>
>> However, when running the same image (jenkins/inbound-agent:4.3-4) in
>> docker directly, there is a jenkins user:
>>
>> sudo docker run -it --rm jenkins/inbound-agent:4.3-4 bash
>> jenkins@255a3961e41e:~$ cat /etc/passwd
>> root:x:0:0:root

RE: Kubernetes Plugin: How to run commands within agent container as non-root?

2020-09-15 Thread iris Jasper Orschulko
Hi Vincent,

I am fairly certain, that the images are identical, as I used to pod image from 
the jenkins logs (jenkins/inbound-agent:4.3-4). The second image I used in the 
pipeline for the build process was https://hub.docker.com/r/kasproject/kas 
which also should have a non-root user (builder, uid 3). I am not sure how 
Jenkins handles the containerisation, but unless there is some magic in the 
background I do not understand, it should be one of those images.

Best regards

Mit freundlichen Grüßen

Jasper Orschulko
Build- und Configurationsmanager

Tel. +49 30 58 58 14 265
Fax +49 30 58 58 14 999
jasper.orschu...@irisgmbh.de<mailto:jasper.orschu...@irisgmbh.de>

• • • • • • • • • • • • • • • • • • • • • • • • • •

iris-GmbH
infrared & intelligent sensors
Ostendstraße 1-14 | 12459 Berlin

Geschäftsführer
M.-O. Brammann | R. Bönick | A. Thun
Amtsgericht Berlin-Charlottenburg
HRB 41 448 | USt-ID-Nr. DE 137228225

www.irisgmbh.de



From: jenkinsci-users@googlegroups.com [jenkinsci-users@googlegroups.com] on 
behalf of Vincent Latombe [vincent.lato...@gmail.com]
Sent: Friday, September 11, 2020 11:50 AM
To: Jenkins Users
Subject: Re: Kubernetes Plugin: How to run commands within agent container as 
non-root?

> [Pipeline] container

What is your container definition? I really doubt it is the same image as what 
you're running through docker CLI.

Vincent


Le jeu. 10 sept. 2020 à 19:59, iris Jasper Orschulko 
mailto:jasper.orschu...@irisgmbh.de>> a écrit :
I am trying to run a Pipeline in a Kubernetes agent, which needs to execute 
commands as non-root user. So I tried setting the securityContext of the Pod to 
1000 (the default jenkins user) as described here: 
https://plugins.jenkins.io/kubernetes/. However, the user does not exist in the 
container within Kubernetes:

[Pipeline] {
[Pipeline] stage
[Pipeline] { (Yocto Build)
[Pipeline] container
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh

+ set -ex
+ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System 
(admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin

However, when running the same image (jenkins/inbound-agent:4.3-4) in docker 
directly, there is a jenkins user:

sudo docker run -it --rm jenkins/inbound-agent:4.3-4 bash
jenkins@255a3961e41e:~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System 
(admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
jenkins:x:1000:1000:Jenkins user:/home/jenkins:/bin/sh

Any ideas why this might be the case? Is this intentional? If so, what would be 
the right way to run the container as non-root?

Best regards

Mit freundlichen Grüßen

Jasper Orschulko
Build- und Configurationsmanager

Tel. +49 30 58 58 14 265
Fax +49 30 58 58 14 999
jasper.orschu...@irisgmbh.de<mailto:jasper.orschu...@irisgmbh.de>

• • • • • • • • • • • • • • • • • • • • • • • • • •

iris-GmbH
infrared & intelligent sensors
Ostendstraße 1-14 | 12459 Berlin

Geschäftsführer
M.-O. Brammann | R. Bönick | A. Thun
Amtsgericht Berlin-Charlottenburg
HRB 41 448 | USt-ID-Nr. DE 137228225

www.irisgmbh.de<http://www.irisgmbh.de>


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

Re: Kubernetes Plugin: How to run commands within agent container as non-root?

2020-09-11 Thread Vincent Latombe
> [Pipeline] container

What is your container definition? I really doubt it is the same image as
what you're running through docker CLI.

Vincent


Le jeu. 10 sept. 2020 à 19:59, iris Jasper Orschulko <
jasper.orschu...@irisgmbh.de> a écrit :

> I am trying to run a Pipeline in a Kubernetes agent, which needs to
> execute commands as non-root user. So I tried setting the securityContext
> of the Pod to 1000 (the default jenkins user) as described here:
> https://plugins.jenkins.io/kubernetes/. However, the user does not exist
> in the container within Kubernetes:
>
> [Pipeline] {
> [Pipeline] stage
> [Pipeline] { (Yocto Build)
> [Pipeline] container
> [Pipeline] {
> [Pipeline] script
> [Pipeline] {
> [Pipeline] sh
>
> + set -ex
> + cat /etc/passwd
> root:x:0:0:root:/root:/bin/bash
> daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
> bin:x:2:2:bin:/bin:/usr/sbin/nologin
> sys:x:3:3:sys:/dev:/usr/sbin/nologin
> sync:x:4:65534:sync:/bin:/bin/sync
> games:x:5:60:games:/usr/games:/usr/sbin/nologin
> man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
> lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
> mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
> news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
> uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
> proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
> www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
> backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
> list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
> irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
> gnats:x:41:41:Gnats Bug-Reporting System
> (admin):/var/lib/gnats:/usr/sbin/nologin
> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
> _apt:x:100:65534::/nonexistent:/usr/sbin/nologin
>
> However, when running the same image (jenkins/inbound-agent:4.3-4) in
> docker directly, there is a jenkins user:
>
> sudo docker run -it --rm jenkins/inbound-agent:4.3-4 bash
> jenkins@255a3961e41e:~$ cat /etc/passwd
> root:x:0:0:root:/root:/bin/bash
> daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
> bin:x:2:2:bin:/bin:/usr/sbin/nologin
> sys:x:3:3:sys:/dev:/usr/sbin/nologin
> sync:x:4:65534:sync:/bin:/bin/sync
> games:x:5:60:games:/usr/games:/usr/sbin/nologin
> man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
> lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
> mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
> news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
> uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
> proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
> www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
> backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
> list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
> irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
> gnats:x:41:41:Gnats Bug-Reporting System
> (admin):/var/lib/gnats:/usr/sbin/nologin
> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
> _apt:x:100:65534::/nonexistent:/usr/sbin/nologin
> jenkins:x:1000:1000:Jenkins user:/home/jenkins:/bin/sh
>
> Any ideas why this might be the case? Is this intentional? If so, what
> would be the right way to run the container as non-root?
>
> Best regards
>
> Mit freundlichen Grüßen
>
> Jasper Orschulko
> Build- und Configurationsmanager
>
> Tel. +49 30 58 58 14 265
> Fax +49 30 58 58 14 999
> jasper.orschu...@irisgmbh.de
>
> • • • • • • • • • • • • • • • • • • • • • • • • • •
>
> iris-GmbH
> infrared & intelligent sensors
> Ostendstraße 1-14 | 12459 Berlin
>
> Geschäftsführer
> M.-O. Brammann | R. Bönick | A. Thun
> Amtsgericht Berlin-Charlottenburg
> HRB 41 448 | USt-ID-Nr. DE 137228225
>
> www.irisgmbh.de
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/38B822B13B092D4C832A97382607EFDF07CF24E0%40ERDE.irisgmbh.local
> .
>

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


Kubernetes Plugin: How to run commands within agent container as non-root?

2020-09-10 Thread iris Jasper Orschulko
I am trying to run a Pipeline in a Kubernetes agent, which needs to execute 
commands as non-root user. So I tried setting the securityContext of the Pod to 
1000 (the default jenkins user) as described here: 
https://plugins.jenkins.io/kubernetes/. However, the user does not exist in the 
container within Kubernetes:

[Pipeline] {
[Pipeline] stage
[Pipeline] { (Yocto Build)
[Pipeline] container
[Pipeline] {
[Pipeline] script
[Pipeline] {
[Pipeline] sh

+ set -ex
+ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System 
(admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin

However, when running the same image (jenkins/inbound-agent:4.3-4) in docker 
directly, there is a jenkins user:

sudo docker run -it --rm jenkins/inbound-agent:4.3-4 bash
jenkins@255a3961e41e:~$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System 
(admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
jenkins:x:1000:1000:Jenkins user:/home/jenkins:/bin/sh

Any ideas why this might be the case? Is this intentional? If so, what would be 
the right way to run the container as non-root?

Best regards

Mit freundlichen Grüßen

Jasper Orschulko
Build- und Configurationsmanager

Tel. +49 30 58 58 14 265
Fax +49 30 58 58 14 999
jasper.orschu...@irisgmbh.de

• • • • • • • • • • • • • • • • • • • • • • • • • •

iris-GmbH
infrared & intelligent sensors
Ostendstraße 1-14 | 12459 Berlin

Geschäftsführer
M.-O. Brammann | R. Bönick | A. Thun
Amtsgericht Berlin-Charlottenburg
HRB 41 448 | USt-ID-Nr. DE 137228225

www.irisgmbh.de


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/38B822B13B092D4C832A97382607EFDF07CF24E0%40ERDE.irisgmbh.local.


Re: [kubernetes-plugin | casc ] Different behaviour between declarative and casc configuration ?

2020-09-09 Thread Vincent Latombe
(this is rather a question for Jenkins Users)

This smells like a bug. Please open a jira issue with a reproducer.

Vincent


Le mer. 9 sept. 2020 à 10:32, aben...@redhat.com  a
écrit :

> Hi Jenkins-Dev,
>
> I am trying to port a configuration of the kubernetes-plugin between
> servers and I was facing an issue while trying to use the casc to do it.
>
> If I use declarative (or yaml) in Jenkinsfile to declare a podTemplate()
> , I can safely omit the containerTemplate named `jnlp` and it seems that
> this one is automatically created and it uses a default image that does the
> job.
>
> If I use casc, and omit it on purposes, it seems to have a different
> behaviour, and actually in runtime, I face a NullPointerException.
>
>
> ```
> 2020-09-08 15:02:39.434+ [id=41] WARNING 
> o.c.j.p.k.KubernetesLauncher#launch:
> Error in provisioning; agent=KubernetesSlave name: maven-jw1z8,
> template=PodTemplate{, name='maven', slaveConnectTimeout=30, label='maven',
> serviceAccount='jenkins', nodeUsageMode=EXCLUSIVE,
> workspaceVolume=EmptyDirWorkspaceVolume [memory=false],
> containers=[ContainerTemplate{name='maven',
> image='image-registry.openshift-image-registry.svc:5000/openshift/jenkins-agent-maven:latest',
> alwaysPullImage=true, workingDir='/tmp'}]}
> java.lang.NullPointerException
> at
> org.csanchez.jenkins.plugins.kubernetes.PodUtils.cancelQueueItemFor(PodUtils.java:76)
> at
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:138)
> at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:297)
> at
> jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
> at
> jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> ```
>
> If I forcibely create the `jnlp` container using my agent image, it seems
> to work. But, I want to get rid of the jnlp container and use the default
> one actually. Any idea ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/93d89e27-b3d4-4e20-90d1-9adff9bace59n%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/93d89e27-b3d4-4e20-90d1-9adff9bace59n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAH-zGCi%3DF1owG1XRLBERS%3Dbvip%3D3EKXEBHmwiC6KgLDwDRmWFQ%40mail.gmail.com.


kubernetes plugin issue with workingDir set as /home/jenkins/agent

2020-06-16 Thread b Od


Hi,

One issue we noticed after we upgraded the Kubernetes Jenkins pluging to 
version 1.26, we see that our jnlp slave Jenkins pod no longer mounts 
/home/Jenkins any more as *read/write* and this is breaking all our jobs 
(it does mount /home/Jenkins/*agent* but our builds need to edit some files 
(.gradle files) that exist on /home/Jenkins as read/write. A workaround is 
to edit each Jenkinsfile and manually edit the workingDir but difficult as 
we have many jobs.

 

Can see  that version 1.26 of the plugin is supposed to have supported 
maintaining the legacy workingDir of "/home/jenkins" but isn’t working for 
us. https://github.com/jenkinsci/kubernetes-plugin/pull/713

 

Wondering if anyone else is having the same issue.

Thanks

Brian

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7950e28f-1240-412f-9f94-3c7426b59d38o%40googlegroups.com.


Re: Jenkins Kubernetes plugin - scheduling hangs when there are more than 1000 builds in queue

2020-06-08 Thread Vincent Latombe
Set up a logger on package org.csanchez.jenkins.plugins.kubernetes to get
more details about the provisioning.

The NodeProvisioning system properties suggested above are not necessary
(the plugin has its own implementation of NodeProvisioner.Strategy which
bypasses the built-in clock)

Vincent


Le dim. 7 juin 2020 à 02:47, Liejun Tao  a écrit :

> Have you tried this?
>   -Dhudson.slaves.NodeProvisioner.initialDelay=0 \
>   -Dhudson.slaves.NodeProvisioner.MARGIN=50 \
>   -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85 \
> In the jenkins.log, is there anything interesting when you expect an agent
> get provisioned but it didn't?
>
> IMHO I would think the "concurrent limit" is way too high.
> How about start with 100 then tune it high?
>
>
>
> On Fri, Jun 5, 2020 at 1:24 PM Andrey Babushkin 
> wrote:
>
>> Greetings Jenkins community!
>>
>> My team uses Jenkins to run long validation cycles. We use Kubernetes
>> plugin (we run our own bare-metal cluster) and many quick single test case
>> builds.
>> Recently our number of test cases have grown drastically and we've
>> noticed that scheduling of new builds is very slow despite we have enough
>> compute resources in cluster.
>>
>> To summarize the problem:
>>
>>- Jenkins has over 1000 builds in queue
>>- They weren't started at the same time - number of builds grows from
>>zero to 1000 within 14 hours. We've added this delay to, well, prevent
>>Jenkins from hanging :)
>>- Those builds schedule very slowly (so queue size decreases not as
>>fast as we desire)
>>- There are enough resources in Kubernetes cluster - therefore
>>slowness isn't caused by long waiting time. Other Jenkins instances we 
>> have
>>can schedule builds quickly into the same Kubernetes (so Kubernetes is 
>> fine)
>>- UI is responsive, but actions like configSubmit on jobs or nodes
>>are slow
>>
>>
>> This server runs only validation cycles, no builds are executed directly
>> on master. We use Jenkins from official Docker image 2.222.3-jdk11 with
>> Kubernetes plugin version 1.24.
>> Hardware-wise we have server with two Intel(R) Xeon(R) CPU E5-2670
>> 2.60GHz (8 cores each with hyper-threading enabled - 32 vCPU in total) and
>> 128GB of RAM.
>> Jenkins container uses --network=host option, inbound (JNLP) agents
>> provisioned by Kubernetes plugin use random port.
>> Settings of Kubernetes cloud we use:
>>
>> [image: Annotation 2020-06-05 210612.png]
>> We've increased Max connections to Kubernetes API when the problem
>> appeared (we thought we may have been bounded by number of connections).
>> I've attached plugins.txt file also and here are JVM options we use:
>> JAVA_OPTS=-Xms64G -Xmx64G
>> -XX:+HeapDumpOnOutOfMemoryError
>>
>> -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=84000
>> -Dpermissive-script-security.enabled=no_security # don't do this
>> in production
>> -Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Moscow
>> -Dhudson.model.DirectoryBrowserSupport.CSP=
>> -Dfile.encoding=UTF-8
>>
>> -Djenkins.displayurl.provider=org.jenkinsci.plugins.displayurlapi.ClassicDisplayURLProvider
>>
>> -Xlog:gc*,gc+ref=debug,gc+heap=debug,gc+age=trace:file=/var/jenkins_home/gc-%p-%t.log:tags,uptime,time,level:filecount=10,filesize=500m
>> -XX:-UseCompressedOops
>> -Dcom.sun.management.jmxremote
>> -Dcom.sun.management.jmxremote.port=9090
>> -Dcom.sun.management.jmxremote.rmi.port=9090
>> -Dcom.sun.management.jmxremote.local.only=false
>> -Dcom.sun.management.jmxremote.authenticate=false
>> -Dcom.sun.management.jmxremote.ssl=false
>>
>>
>> As you can see we've tried to profile Jenkins with VisualVM. I have
>> thread dump and snapshot, but I don't want to share them publicly. I can
>> send it to you personally, if you want to take a look.
>> CPU was completely fine, around 20% and GC takes as little as 0.1%
>>
>> [image: peak_cpu.png]
>>
>>
>> At this moment my team and me are out of guesses, so I'd appreciate any
>> advice you have
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https:/

Re: Jenkins Kubernetes plugin - scheduling hangs when there are more than 1000 builds in queue

2020-06-06 Thread Liejun Tao
Have you tried this?
  -Dhudson.slaves.NodeProvisioner.initialDelay=0 \
  -Dhudson.slaves.NodeProvisioner.MARGIN=50 \
  -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85 \
In the jenkins.log, is there anything interesting when you expect an agent
get provisioned but it didn't?

IMHO I would think the "concurrent limit" is way too high.
How about start with 100 then tune it high?



On Fri, Jun 5, 2020 at 1:24 PM Andrey Babushkin  wrote:

> Greetings Jenkins community!
>
> My team uses Jenkins to run long validation cycles. We use Kubernetes
> plugin (we run our own bare-metal cluster) and many quick single test case
> builds.
> Recently our number of test cases have grown drastically and we've noticed
> that scheduling of new builds is very slow despite we have enough compute
> resources in cluster.
>
> To summarize the problem:
>
>- Jenkins has over 1000 builds in queue
>- They weren't started at the same time - number of builds grows from
>zero to 1000 within 14 hours. We've added this delay to, well, prevent
>Jenkins from hanging :)
>- Those builds schedule very slowly (so queue size decreases not as
>fast as we desire)
>- There are enough resources in Kubernetes cluster - therefore
>slowness isn't caused by long waiting time. Other Jenkins instances we have
>can schedule builds quickly into the same Kubernetes (so Kubernetes is 
> fine)
>- UI is responsive, but actions like configSubmit on jobs or nodes are
>slow
>
>
> This server runs only validation cycles, no builds are executed directly
> on master. We use Jenkins from official Docker image 2.222.3-jdk11 with
> Kubernetes plugin version 1.24.
> Hardware-wise we have server with two Intel(R) Xeon(R) CPU E5-2670 2.60GHz
> (8 cores each with hyper-threading enabled - 32 vCPU in total) and 128GB of
> RAM.
> Jenkins container uses --network=host option, inbound (JNLP) agents
> provisioned by Kubernetes plugin use random port.
> Settings of Kubernetes cloud we use:
>
> [image: Annotation 2020-06-05 210612.png]
> We've increased Max connections to Kubernetes API when the problem
> appeared (we thought we may have been bounded by number of connections).
> I've attached plugins.txt file also and here are JVM options we use:
> JAVA_OPTS=-Xms64G -Xmx64G
> -XX:+HeapDumpOnOutOfMemoryError
>
> -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=84000
> -Dpermissive-script-security.enabled=no_security # don't do this
> in production
> -Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Moscow
> -Dhudson.model.DirectoryBrowserSupport.CSP=
> -Dfile.encoding=UTF-8
>
> -Djenkins.displayurl.provider=org.jenkinsci.plugins.displayurlapi.ClassicDisplayURLProvider
>
> -Xlog:gc*,gc+ref=debug,gc+heap=debug,gc+age=trace:file=/var/jenkins_home/gc-%p-%t.log:tags,uptime,time,level:filecount=10,filesize=500m
> -XX:-UseCompressedOops
> -Dcom.sun.management.jmxremote
> -Dcom.sun.management.jmxremote.port=9090
> -Dcom.sun.management.jmxremote.rmi.port=9090
> -Dcom.sun.management.jmxremote.local.only=false
> -Dcom.sun.management.jmxremote.authenticate=false
> -Dcom.sun.management.jmxremote.ssl=false
>
>
> As you can see we've tried to profile Jenkins with VisualVM. I have thread
> dump and snapshot, but I don't want to share them publicly. I can send it
> to you personally, if you want to take a look.
> CPU was completely fine, around 20% and GC takes as little as 0.1%
>
> [image: peak_cpu.png]
>
>
> At this moment my team and me are out of guesses, so I'd appreciate any
> advice you have
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/7ea695e9-889f-486a-91b9-974a68e0f3d9o%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/7ea695e9-889f-486a-91b9-974a68e0f3d9o%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
Thanks,
Baibai

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


Jenkins Kubernetes plugin - scheduling hangs when there are more than 1000 builds in queue

2020-06-05 Thread Andrey Babushkin
Greetings Jenkins community!

My team uses Jenkins to run long validation cycles. We use Kubernetes 
plugin (we run our own bare-metal cluster) and many quick single test case 
builds.
Recently our number of test cases have grown drastically and we've noticed 
that scheduling of new builds is very slow despite we have enough compute 
resources in cluster.

To summarize the problem:

   - Jenkins has over 1000 builds in queue
   - They weren't started at the same time - number of builds grows from 
   zero to 1000 within 14 hours. We've added this delay to, well, prevent 
   Jenkins from hanging :)
   - Those builds schedule very slowly (so queue size decreases not as fast 
   as we desire)
   - There are enough resources in Kubernetes cluster - therefore slowness 
   isn't caused by long waiting time. Other Jenkins instances we have can 
   schedule builds quickly into the same Kubernetes (so Kubernetes is fine)
   - UI is responsive, but actions like configSubmit on jobs or nodes are 
   slow


This server runs only validation cycles, no builds are executed directly on 
master. We use Jenkins from official Docker image 2.222.3-jdk11 with 
Kubernetes plugin version 1.24. 
Hardware-wise we have server with two Intel(R) Xeon(R) CPU E5-2670 2.60GHz 
(8 cores each with hyper-threading enabled - 32 vCPU in total) and 128GB of 
RAM.
Jenkins container uses --network=host option, inbound (JNLP) agents 
provisioned by Kubernetes plugin use random port.
Settings of Kubernetes cloud we use:

[image: Annotation 2020-06-05 210612.png]
We've increased Max connections to Kubernetes API when the problem appeared 
(we thought we may have been bounded by number of connections).
I've attached plugins.txt file also and here are JVM options we use:
JAVA_OPTS=-Xms64G -Xmx64G
-XX:+HeapDumpOnOutOfMemoryError

-Dorg.jenkinsci.plugins.durabletask.BourneShellScript.HEARTBEAT_CHECK_INTERVAL=84000
-Dpermissive-script-security.enabled=no_security # don't do this in 
production
-Dorg.apache.commons.jelly.tags.fmt.timeZone=Europe/Moscow
-Dhudson.model.DirectoryBrowserSupport.CSP=
-Dfile.encoding=UTF-8

-Djenkins.displayurl.provider=org.jenkinsci.plugins.displayurlapi.ClassicDisplayURLProvider

-Xlog:gc*,gc+ref=debug,gc+heap=debug,gc+age=trace:file=/var/jenkins_home/gc-%p-%t.log:tags,uptime,time,level:filecount=10,filesize=500m
-XX:-UseCompressedOops
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9090
-Dcom.sun.management.jmxremote.rmi.port=9090
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false


As you can see we've tried to profile Jenkins with VisualVM. I have thread 
dump and snapshot, but I don't want to share them publicly. I can send it 
to you personally, if you want to take a look.
CPU was completely fine, around 20% and GC takes as little as 0.1%

[image: peak_cpu.png]


At this moment my team and me are out of guesses, so I'd appreciate any 
advice you have

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7ea695e9-889f-486a-91b9-974a68e0f3d9o%40googlegroups.com.
ace-editor:1.1
ansicolor:0.6.2
ant:1.11
antisamy-markup-formatter:1.8
apache-httpcomponents-client-4-api:4.5.10-2.0
audit-trail:3.3
authentication-tokens:1.3
authorize-project:1.3.0
azure-commons:1.0.4
azure-container-agents:1.1.1
azure-credentials:2.0.1
badge:1.8
basic-branch-build-strategies:1.3.2
blueocean-autofavorite:1.2.4
blueocean-commons:1.22.0
blueocean-config:1.22.0
blueocean-core-js:1.22.0
blueocean-dashboard:1.22.0
blueocean-display-url:2.3.1
blueocean-events:1.22.0
blueocean-git-pipeline:1.22.0
blueocean-github-pipeline:1.22.0
blueocean-i18n:1.22.0
blueocean-jwt:1.22.0
blueocean-personalization:1.22.0
blueocean-pipeline-api-impl:1.22.0
blueocean-pipeline-editor:1.22.0
blueocean-pipeline-scm-api:1.22.0
blueocean-rest-impl:1.22.0
blueocean-rest:1.22.0
blueocean-web:1.22.0
bootstrap4-api:4.4.1-15
bouncycastle-api:2.18
branch-api:2.5.5
build-user-vars-plugin:1.5
build-with-parameters:1.4
cloudbees-folder:6.11.1
command-launcher:1.4
conditional-buildstep:1.3.6
configuration-as-code:1.35
copyartifact:1.43
credentials-binding:1.21
credentials:2.3.1
dashboard-view:2.12
data-tables-api:1.10.20-15
discard-old-build:1.05
display-url-api:2.3.2
docker-commons:1.16
docker-java-api:3.0.14
docker-workflow:1.21
dtkit-api:2.1.2
durable-task:1.33
email-ext:2.68
favorite:2.3.2
git-client:3.1.1
git-server:1.9
git:4.2.2
github-autostatus:3.6.1
gitlab-api:1.0.6
gitlab-branch-source:1.5.1
google-oauth-plugin:1.0.0
htmlpublisher:1.21
http_request:1.8.24
influxdb:2.

Re: Kubernetes plugin + vanilla node/agent - classcast exception

2020-05-07 Thread Liejun Tao
You may start the pipeline with agent none, the do one stage with the k8s
node, another stage with the other node.



On Thu, May 7, 2020, 9:02 AM David Karlsen  wrote:

> I have a pipeline which uses the Kubernetes Jenkins plugin:
>
> pipeline {
>   agent {
> kubernetes {
>   cloud 'icp-global'
>   defaultContainer 'node'
>   // customWorkspace '/workspace'
>   yamlFile 'buildPod.yaml'
> }
>
> but would like to run another step outside of containers, like:
>   stage('deploy') {
>   steps {
> node('rhel7') { <-- outside of k8s
>   sh '''
> do the thing
>   '''
> }
>   }
> }
>
> But I get:
>
> [Bitbucket] Notifying commit build result
> [Bitbucket] Build result notified
> java.lang.ClassCastException: hudson.plugins.swarm.SwarmSlave cannot be cast 
> to org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave
>   at 
> org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:250)
>   at hudson.Launcher$ProcStarter.start(Launcher.java:455)
>   at 
> org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:233)
>   at 
> org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoring
>
>
> Is this not supported?
>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAGO7Ob2Fn-LYv42_WKPNU39-TN79q%3DKiP4_rmaWO%3DN9Zpn5Qhw%40mail.gmail.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMRm5jZurLgkw6hRNCKFpuBpSqOk%2B4ONdhNRKvZNjoZqdBJeuQ%40mail.gmail.com.


Kubernetes plugin + vanilla node/agent - classcast exception

2020-05-07 Thread David Karlsen
I have a pipeline which uses the Kubernetes Jenkins plugin:

pipeline {
  agent {
kubernetes {
  cloud 'icp-global'
  defaultContainer 'node'
  // customWorkspace '/workspace'
  yamlFile 'buildPod.yaml'
}

but would like to run another step outside of containers, like:
  stage('deploy') {
  steps {
node('rhel7') { <-- outside of k8s
  sh '''
do the thing
  '''
}
  }
}

But I get:

[Bitbucket] Notifying commit build result
[Bitbucket] Build result notified
java.lang.ClassCastException: hudson.plugins.swarm.SwarmSlave cannot
be cast to org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave
at 
org.csanchez.jenkins.plugins.kubernetes.pipeline.ContainerExecDecorator$1.launch(ContainerExecDecorator.java:250)
at hudson.Launcher$ProcStarter.start(Launcher.java:455)
at 
org.jenkinsci.plugins.durabletask.BourneShellScript.launchWithCookie(BourneShellScript.java:233)
at 
org.jenkinsci.plugins.durabletask.FileMonitoringTask.launch(FileMonitoring


Is this not supported?

-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAGO7Ob2Fn-LYv42_WKPNU39-TN79q%3DKiP4_rmaWO%3DN9Zpn5Qhw%40mail.gmail.com.


Unable to set pod retention for Jenkins Kubernetes plugin Groovy script.

2020-04-16 Thread santhosh kumar
Trying to configure pod retention value  for Jenkins Kubernetes plugin using
groovy script.
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.Podretention.Never())
method is failing to configure with below error :

Invalid value provided in main configuration No signature of method: static
org.csanchez.jenkins.plugins.kubernetes.pod.retention.PodRetention.Never()
is applicable for argument types: () values: []

tried configuring by using different values for the method:
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.Never)

Error using the above value as well.

Please some one help me on this as i was struck with this from quite a long.

Below is the code:

import java.util.logging.Logger
import hudson.*
import hudson.model.*
import java.io.PrintWriter
import java.io.StringWriter
import jenkins.*
import jenkins.install.InstallState
import jenkins.model.*
import jenkins.util.xml.*
import javax.xml.xpath.*
import com.cloudbees.plugins.credentials.*
import com.cloudbees.plugins.credentials.impl.*
import com.cloudbees.plugins.credentials.common.*
import com.cloudbees.plugins.credentials.domains.*
import com.cloudbees.jenkins.plugins.sshcredentials.impl.*
import org.jenkinsci.plugins.plaincredentials.impl.*
import org.jenkinsci.plugins.docker.commons.credentials.*
import org.csanchez.jenkins.plugins.kubernetes.*
import org.csanchez.jenkins.plugins.kubernetes.pod.retention.PodRetention

KubernetesCloud kubernetes = new KubernetesCloud('test')
kubernetes.setServerUrl('http://test_url')
kubernetes.setMaxRequestsPerHostStr(20)
kubernetes.setPodRetention(org.csanchez.jenkins.plugins.kube
rnetes.pod.retention.PodRetention.Never())
kubernetes.setWaitForPodSec(90)

// documentation reference

 https://javadoc.jenkins.io/plugin/kubernetes/

// Method used
setPodRetention(PodRetention podRetention)
Set the global pod retention policy for the plugin.

Can some let me know how to set the pod retention value using groovy with 
setPodRetention

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/63d27137-2d47-4d88-af53-c04ec482aa7a%40googlegroups.com.


Re: kubernetes-plugin and PersistentVolumeClaims

2020-01-14 Thread scottyg
kubernetes-cd is certainly possible, though I haven't figured out how I 
would use in in a declarative pipeline in conjunction with the 
kubernetes-plugin yet. But overall it's a less than ideal solution for my 
use case:
- Cannot use the existing configuration with kubernetes-plugin
- Have to install kubectl on some non-kube node.

I was hoping to find a natural way to integrate creation of PVC before 
agent launch into kubernetes-plugin but I'm not seeing a clean way to 
accomplish it.


On Monday, January 13, 2020 at 8:48:00 PM UTC-6, Usov Dmitri wrote:
>
> https://github.com/jenkinsci/kubernetes-cd-plugin
>
> kubernetes-cd plugin has the capability to create a pvc, the recent plugin 
> version has got fixed an issue with subsequent invocation of a yaml that 
> creates/updates a pvc.
>
> Regards,
> Dmitri
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a6a460e4-2393-4c80-8003-cda1d6353e12%40googlegroups.com.


Re: kubernetes-plugin and PersistentVolumeClaims

2020-01-13 Thread Usov Dmitri
https://github.com/jenkinsci/kubernetes-cd-plugin

kubernetes-cd plugin has the capability to create a pvc, the recent plugin 
version has got fixed an issue with subsequent invocation of a yaml that 
creates/updates a pvc.

Regards,
Dmitri

On Tuesday, January 14, 2020 at 12:38:46 AM UTC+3, scottyg wrote:
>
> I have a use case where a PersistentVolumeClaim is used to clone a volume 
> snapshot, which is a prebuilt m2 repository. A PVC object needs to be 
> created before creating the Pod object, then deleted after the pod finishes.
>
> Using kubernetes-plugin, it seems that the yaml attribute in the 
> declarative pipeline only supports Pod objects. Before I go off and try to 
> figure out how to script the creation of a PVC object before launching the 
> Pod, I wanted to ask if there is a mechanism in this plugin that would help 
> manage a PVC lifecycle...and I'm just not seeing it. 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/75ceecc2-1223-4398-a04c-882ccb230f97%40googlegroups.com.


kubernetes-plugin and PersistentVolumeClaims

2020-01-13 Thread Scott Grissom
I have a use case where a PersistentVolumeClaim is used to clone a volume 
snapshot, which is a prebuilt m2 repository. A PVC object needs to be 
created before creating the Pod object, then deleted after the pod finishes.

Using kubernetes-plugin, it seems that the yaml attribute in the 
declarative pipeline only supports Pod objects. Before I go off and try to 
figure out how to script the creation of a PVC object before launching the 
Pod, I wanted to ask if there is a mechanism in this plugin that would help 
manage a PVC lifecycle...and I'm just not seeing it. 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e1011b4f-1222-433d-91dd-44c1dba7b748%40googlegroups.com.


Issues with Jenkins master in Openshift cluster creating slaves in another openshift cluster using kubernetes plugin

2019-11-11 Thread pawan kondaveeti


We have two openshift clusters. Installed Jenkins master on one cluster and 
trying to create slaves in another cluster using Kubernetes plugin. Pods 
are created on another cluster when requested but the handshake fails with 
below error.


Nov 06, 2019 12:08:46 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Failed to connect to 
http://jenkins-jenkinsasservice...example.org/tcpSlaveAgentListener/:  
Connection refused (Connection refused)
java.io.IOException: Failed to connect to 
http://jenkins-jenkinsasservice...example.org/tcpSlaveAgentListener/:  
Connection refused (Connection refused)
at hudson.remoting.Engine.run(Engine.java:208)
Caused by: java.net.ConnectException: Connection refused (Connection refused) 


This pod gets deleted. Another pod come in and gets deleted with the same 
error. After a couple of retries pod gets successful handshaking and it 
behaves as slave.

How can i stop getting this connection errors and fix this issue.


Openshift version: 3.11, jenkins Version: 2.176.3, K8 plugin: 1.12

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2b5d361b-5f76-4e0c-89f4-a936bc1842f4%40googlegroups.com.


[Jenkins Kubernetes Plugin] - hudson.remoting.ChannelClosedException: Channel "unknown": Remote call on JNLP4-connect connection from IP/IP:port failed. The channel is closing down or has closed dow

2019-11-01 Thread Eddie Mashayev
Hey all, 

I have opened an issue in Jenkins project, but didn't get any help yet..
Maybe you can help me, link to the issue 
.

Pasting the issue from the link:


It happens frequently not something constant, which makes it very hard to 
debug.

This is my podTemplate:

podTemplate(containers: [
containerTemplate(
name: 'build',
image: 'my_builder:latest',
command: 'cat',
ttyEnabled: true,
workingDir: '/mnt/jenkins'
)
],
volumes: [
hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: 
'/var/run/docker.sock'),
hostPathVolume(mountPath: '/mnt/jenkins', hostPath: '/mnt/jenkins')
],
yaml: """
spec:
 containers:
   - name: build
 resources:
   requests:
 cpu: "10"
 memory: "10Gi" 
 securityContext:
   fsGroup: 995
"""
)
{
node(POD_LABEL) {
stage("Checkout") {
}   
// more stages}
}

This is the log from the pod:

Inbound agent connected from IP/IP
Waiting for agent to connect (0/100): my_branch
Remoting version: 3.35
This is a Unix agent
Waiting for agent to connect (1/100): my_branch
Agent successfully connected and online
ERROR: Connection terminated
java.nio.channels.ClosedChannelException
at 
org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
at 
org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at 
jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Logs from Jenkins "cat /var/log/jenkins/jenkins.log":

2019-10-08 14:40:48.171+ [id=287] WARNING 
o.c.j.p.k.KubernetesLauncher#launch: Error in provisioning; 
agent=KubernetesSlave name: branch_name, template=PodTemplate{, 
name='pod_name', namespace='default', label='label_name', 
nodeUsageMode=EXCLUSIVE, volumes=[HostPathVolume 
[mountPath=/var/run/docker.sock, hostPath=/var/run/docker.sock], HostPathVolume 
[mountPath=/mnt/jenkins, hostPath=/mnt/jenkins]], 
containers=[ContainerTemplate{name='build', image='my_builder', 
workingDir='/mnt/jenkins', command='cat', ttyEnabled=true, 
envVars=[KeyValueEnvVar [getValue()=deploy/.dazelrc, getKey()=RC_FILE]]}], 
annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821]} 
io.fabric8.kubernetes.client.KubernetesClientTimeoutException: Timed out 
waiting for [10] milliseconds for [Pod] with name:[branch_name] in 
namespace [default]. at 
org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.await(AllContainersRunningPodWatcher.java:130)
 at 
org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:134)
 at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:297) at 
jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
 at 
jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
at java.lang.Thread.run(Thread.java:748)


It seems to happen for other people as well, but there is no solution, can 
anyone help?


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5b400c6b-f62d-4285-8166-f5db8b541ec3%40googlegroups.com.


Re: [Jenkins Kubernetes Plugin] Issues building plugin from source

2019-10-21 Thread Carlos Sanchez
a jenkins server is started for each of those integration tests.
the port used is printed in the logs

On Mon, Oct 21, 2019 at 6:03 PM 'Andrew Douglas' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Thanks Carlos,
>
> "Some integration tests run a local jenkins" is it possible that this is
> not starting correctly? I can't see a copy of Jenkins running anywhere
> during testing.
>
> I'm using minikube on hyperkit for testing
>
>
> Andrew
>
> On Monday, October 21, 2019 at 11:14:11 AM UTC+1, Carlos Sanchez wrote:
>>
>> you would need to check the pod logs, to see what happened
>> probably the pods can't connect to jenkins and you may need to set the
>> hot ip in maven
>> anyway if you submit a PR it will be tested in jenkins infra and will
>> give you the test results
>>
>> If your minikube is running in a VM (e.g. on virtualbox) and the host
>> running mvn does not have a public hostname for the VM to access, you
>> can set the jenkins.host.address system property to the (host-only or
>> NAT) IP of your host:
>>
>> mvn clean install -Djenkins.host.address=192.168.99.1
>>
>>
>> On Thu, Oct 17, 2019 at 7:22 PM 'Andrew Douglas' via Jenkins Users <
>> jenkins...@googlegroups.com> wrote:
>>
>>> Hi, I am trying to diagnose a potential issue with this plugin and have
>>> downloaded the source (from
>>> https://github.com/jenkinsci/kubernetes-plugin).
>>>
>>> I am running Minikube and have the latest version of Maven. When I try
>>> to build the plugin with the command `mvn clean install
>>> -DconnectorHost=0.0.0.0` I always get at least one integration test failure
>>> and then the build fails. Failures typically look like:
>>>
>>> ```
>>> [INFO] Running
>>> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
>>> [ERROR] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed:
>>> 592.425 s <<< FAILURE! - in
>>> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
>>> [ERROR]
>>> cascadingDelete(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
>>> Time elapsed: 180.127 s  <<< ERROR!
>>> org.junit.runners.model.TestTimedOutException: test timed out after 180
>>> seconds
>>> at java.base@12.0.1/java.lang.Thread.sleep(Native Method)
>>> at
>>> app//org.jvnet.hudson.test.JenkinsRule.waitForCompletion(JenkinsRule.java:1430)
>>> at
>>> app//org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest.cascadingDelete(KubernetesPipelineTest.java:404)
>>> at 
>>> java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>> at java.base@12.0.1
>>> /jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>> at java.base@12.0.1
>>> /jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.base@12.0.1
>>> /java.lang.reflect.Method.invoke(Method.java:567)
>>> at
>>> app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>> at
>>> app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>> at
>>> app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>>> at
>>> app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>> at
>>> app//org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>>> at
>>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>>> at
>>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>>> at
>>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>>> at
>>> app//org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
>>> at
>>> app//org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:600)
>>> at
>>> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
>>> at
>>> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
>>> at java.base@12.0.1
>>

Re: [Jenkins Kubernetes Plugin] Issues building plugin from source

2019-10-21 Thread 'Andrew Douglas' via Jenkins Users
Thanks Carlos,

"Some integration tests run a local jenkins" is it possible that this is 
not starting correctly? I can't see a copy of Jenkins running anywhere 
during testing.

I'm using minikube on hyperkit for testing


Andrew

On Monday, October 21, 2019 at 11:14:11 AM UTC+1, Carlos Sanchez wrote:
>
> you would need to check the pod logs, to see what happened 
> probably the pods can't connect to jenkins and you may need to set the hot 
> ip in maven
> anyway if you submit a PR it will be tested in jenkins infra and will give 
> you the test results
>
> If your minikube is running in a VM (e.g. on virtualbox) and the host 
> running mvn does not have a public hostname for the VM to access, you can 
> set the jenkins.host.address system property to the (host-only or NAT) IP 
> of your host:
>
> mvn clean install -Djenkins.host.address=192.168.99.1
>
>
> On Thu, Oct 17, 2019 at 7:22 PM 'Andrew Douglas' via Jenkins Users <
> jenkins...@googlegroups.com > wrote:
>
>> Hi, I am trying to diagnose a potential issue with this plugin and have 
>> downloaded the source (from 
>> https://github.com/jenkinsci/kubernetes-plugin).
>>
>> I am running Minikube and have the latest version of Maven. When I try to 
>> build the plugin with the command `mvn clean install 
>> -DconnectorHost=0.0.0.0` I always get at least one integration test failure 
>> and then the build fails. Failures typically look like:
>>
>> ```
>> [INFO] Running 
>> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
>> [ERROR] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 
>> 592.425 s <<< FAILURE! - in 
>> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
>> [ERROR] 
>> cascadingDelete(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
>>   
>> Time elapsed: 180.127 s  <<< ERROR!
>> org.junit.runners.model.TestTimedOutException: test timed out after 180 
>> seconds
>> at java.base@12.0.1/java.lang.Thread.sleep(Native Method)
>> at 
>> app//org.jvnet.hudson.test.JenkinsRule.waitForCompletion(JenkinsRule.java:1430)
>> at 
>> app//org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest.cascadingDelete(KubernetesPipelineTest.java:404)
>> at 
>> java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
>>  
>> Method)
>> at 
>> java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> at 
>> java.base@12.0.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at 
>> java.base@12.0.1/java.lang.reflect.Method.invoke(Method.java:567)
>> at 
>> app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>> at 
>> app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>> at 
>> app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>> at 
>> app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>> at 
>> app//org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>> at 
>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>> at 
>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>> at 
>> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>> at 
>> app//org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
>> at 
>> app//org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:600)
>> at 
>> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
>> at 
>> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
>> at 
>> java.base@12.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
>> at java.base@12.0.1/java.lang.Thread.run(Thread.java:835)
>>
>> [ERROR] 
>> computerCantBeConfigured(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
>>   
>> Time elapsed: 0.493 s  <<< ERROR!
>> org.jvnet.hudson.reactor.ReactorException: java.lang.Error: 
>> java.lang.reflect.InvocationTargetException
>> at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
>> at jenkins.InitReactor

Re: [Jenkins Kubernetes Plugin] Issues building plugin from source

2019-10-21 Thread Carlos Sanchez
you would need to check the pod logs, to see what happened
probably the pods can't connect to jenkins and you may need to set the hot
ip in maven
anyway if you submit a PR it will be tested in jenkins infra and will give
you the test results

If your minikube is running in a VM (e.g. on virtualbox) and the host
running mvn does not have a public hostname for the VM to access, you can
set the jenkins.host.address system property to the (host-only or NAT) IP
of your host:

mvn clean install -Djenkins.host.address=192.168.99.1


On Thu, Oct 17, 2019 at 7:22 PM 'Andrew Douglas' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hi, I am trying to diagnose a potential issue with this plugin and have
> downloaded the source (from https://github.com/jenkinsci/kubernetes-plugin
> ).
>
> I am running Minikube and have the latest version of Maven. When I try to
> build the plugin with the command `mvn clean install
> -DconnectorHost=0.0.0.0` I always get at least one integration test failure
> and then the build fails. Failures typically look like:
>
> ```
> [INFO] Running
> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
> [ERROR] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed:
> 592.425 s <<< FAILURE! - in
> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
> [ERROR]
> cascadingDelete(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
> Time elapsed: 180.127 s  <<< ERROR!
> org.junit.runners.model.TestTimedOutException: test timed out after 180
> seconds
> at java.base@12.0.1/java.lang.Thread.sleep(Native Method)
> at
> app//org.jvnet.hudson.test.JenkinsRule.waitForCompletion(JenkinsRule.java:1430)
> at
> app//org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest.cascadingDelete(KubernetesPipelineTest.java:404)
> at 
> java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at java.base@12.0.1
> /jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at java.base@12.0.1
> /jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base@12.0.1
> /java.lang.reflect.Method.invoke(Method.java:567)
> at
> app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> at
> app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> at
> app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> at
> app//org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at
> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at
> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at
> app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
> at app//org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
> at
> app//org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:600)
> at
> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
> at
> app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
> at java.base@12.0.1
> /java.util.concurrent.FutureTask.run(FutureTask.java:264)
> at java.base@12.0.1/java.lang.Thread.run(Thread.java:835)
>
> [ERROR]
> computerCantBeConfigured(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
> Time elapsed: 0.493 s  <<< ERROR!
> org.jvnet.hudson.reactor.ReactorException: java.lang.Error:
> java.lang.reflect.InvocationTargetException
> at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
> at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
> at jenkins.model.Jenkins.executeReactor(Jenkins.java:1152)
> at jenkins.model.Jenkins.(Jenkins.java:959)
> at hudson.model.Hudson.(Hudson.java:85)
> at
> org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:675)
> at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:402)
> at
> org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:595)
> at
> org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
> at
> org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
> at
&g

Re: Jenkins Kubernetes Plugin not honoring activeDeadlineSeconds parameter

2019-10-18 Thread drpm
I tried this one but the pod still got terminated. 

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

podTemplate(label: label, *activeDeadlineSeconds: 3600,* yaml: """

apiVersion: v1

kind: Pod

metadata:

  labels:

slave: jenkins-slave-testing-build

spec:

  containers:

  - name: slave

image: '/jenkins-slave'

tty: true

command:

- cat

  nodeSelector:

xyz.com/app: cibuild

  tolerations:

  - effect: NoSchedule

key: xyz.com/abc.xyz.com

operator: Equal

value: cibuild

"""

){

node (label) {

  withEnv(['USER=jenkins']) {

container('slave') {

  stage("test") {

sh "echo test"

  }

}

  }

}

}


LOGS:

Oct 18, 2019 9:57:39 AM FINE 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesComputer
> Computer KubernetesComputer name: 
> jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q slave: null 
> completed task 
> PlaceholderExecutable:ExecutorStepExecution.PlaceholderTask{runId=testing#47,label=jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q,context=CpsStepContext[5:node]:Owner[testing/47:testing
>  
> #47],cookie=2b863d15-f6f0-431f-8081-5eea211b992b,auth=null}
> Oct 18, 2019 9:57:39 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave 
> _terminate
> Terminating Kubernetes instance for agent 
> jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q
> Oct 18, 2019 9:57:39 AM FINE 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud
> Building connection to Kubernetes kubernetes URL 
> https://kubernetes.default namespace cibuild
> Oct 18, 2019 9:57:39 AM FINE 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud
> Connected to Kubernetes kubernetes URL https://kubernetes.default/
> Oct 18, 2019 9:57:39 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution$PodTemplateCallback
>  
> finished
> Removing pod template 
> jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de7171c-npz46 from cloud 
> kubernetes
> Oct 18, 2019 9:57:39 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave 
> deleteSlavePod
> Terminated Kubernetes instance for agent 
> cibuild/jenkin-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q
> Oct 18, 2019 9:57:39 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave 
> _terminate
> Disconnected computer 
> jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q
> Oct 18, 2019 9:57:39 AM FINE 
> org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper
> received deletion notice for 
> cibuild/jenkins-test-build-ae2e7dee-8f0f-48b8-8a3f-39fd1de717-0ct7q which 
> does not seem to correspond to any Jenkins agent 





On Friday, October 18, 2019 at 6:51:49 PM UTC+9, Carlos Sanchez wrote:
>
> Ah ok, for that one you need to set it at podTemplate level, not inside 
> the yaml
>
>
> On Fri, Oct 18, 2019, 11:38 drpm > wrote:
>
>> Hello, 
>>
>> Thank you for your reply. 
>>
>> It says here (https://github.com/jenkinsci/kubernetes-plugin) that pod 
>> will be deleted after the set activeDeadlineSeconds is passed or am I 
>> totally reading it wrong? 
>>
>>- podRetention Controls the behavior of keeping slave pods. Can be 
>>'never()', 'onFailure()', 'always()', or 'default()' - if empty will 
>>default to deleting the pod after activeDeadlineSeconds has passed.
>>- activeDeadlineSeconds If podRetention is set to 'never()' or 
>>'onFailure()', pod is deleted after this deadline is passed.
>>
>> If this is totally wrong, can you recommend a right way to retain a pod 
>> even if the job is finished using this plugin? 
>>
>> On Friday, October 18, 2019 at 6:17:06 PM UTC+9, Carlos Sanchez wrote:
>>>
>>> the plugin will delete the kubernetes pod after the jenkins job is 
>>> completed
>>>
>>> Also I don't think activeDeadlineSeconds is what you want
>>> activeDeadlineSeconds: Optional duration in seconds the pod may be 
>>> active on the node relative to StartTime before the system will actively 
>>> try to mark it failed and kill associated containers. Value must be a 
>>> positive integer.
>>>
>>>
>>> On Fri, Oct 18, 2019 at 11:11 AM drpm  wrote:
>>>
>>>> Hello,
>>>>
>>>> For some reason, jenkins is not honoring *activeDeadlineSeconds* 
>>>> parameter when used in pipeline script. I'm using this kubernetes plugin 
>>>> for jenkins: https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin 
>>>>
>>>> *Sample Pipeline Script*: 
>>>>

Re: Jenkins Kubernetes Plugin not honoring activeDeadlineSeconds parameter

2019-10-18 Thread Carlos Sanchez
Ah ok, for that one you need to set it at podTemplate level, not inside the
yaml


On Fri, Oct 18, 2019, 11:38 drpm  wrote:

> Hello,
>
> Thank you for your reply.
>
> It says here (https://github.com/jenkinsci/kubernetes-plugin) that pod
> will be deleted after the set activeDeadlineSeconds is passed or am I
> totally reading it wrong?
>
>- podRetention Controls the behavior of keeping slave pods. Can be
>'never()', 'onFailure()', 'always()', or 'default()' - if empty will
>default to deleting the pod after activeDeadlineSeconds has passed.
>- activeDeadlineSeconds If podRetention is set to 'never()' or
>'onFailure()', pod is deleted after this deadline is passed.
>
> If this is totally wrong, can you recommend a right way to retain a pod
> even if the job is finished using this plugin?
>
> On Friday, October 18, 2019 at 6:17:06 PM UTC+9, Carlos Sanchez wrote:
>>
>> the plugin will delete the kubernetes pod after the jenkins job is
>> completed
>>
>> Also I don't think activeDeadlineSeconds is what you want
>> activeDeadlineSeconds: Optional duration in seconds the pod may be
>> active on the node relative to StartTime before the system will actively
>> try to mark it failed and kill associated containers. Value must be a
>> positive integer.
>>
>>
>> On Fri, Oct 18, 2019 at 11:11 AM drpm  wrote:
>>
>>> Hello,
>>>
>>> For some reason, jenkins is not honoring *activeDeadlineSeconds*
>>> parameter when used in pipeline script. I'm using this kubernetes plugin
>>> for jenkins: https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin
>>>
>>> *Sample Pipeline Script*:
>>>
>>>
>>> def label = "jenkins-test-build-${UUID.randomUUID().toString()}"
>>>
>>> podTemplate(label: label, yaml: """
>>>
>>> apiVersion: v1
>>>
>>> kind: Pod
>>>
>>> metadata:
>>>
>>>   labels:
>>>
>>> slave: jenkins-slave-testing-build
>>>
>>> spec:
>>>
>>>   activeDeadlineSeconds: 3600
>>>
>>>   containers:
>>>
>>>   - name: slave
>>>
>>> image: '/jenkins-slave'
>>>
>>> tty: true
>>>
>>> command:
>>>
>>> - cat
>>>
>>>   nodeSelector:
>>>
>>> xyz.com/app: cibuild
>>>
>>>   tolerations:
>>>
>>>   - effect: NoSchedule
>>>
>>> key: xyz.com/abc.xyz.com
>>>
>>> operator: Equal
>>>
>>> value: cibuild
>>>
>>> """
>>>
>>> ){
>>>
>>> node (label) {
>>>
>>>   withEnv(['USER=jenkins']) {
>>>
>>> container('slave') {
>>>
>>>   stage("test") {
>>>
>>> sh "echo test"
>>>
>>>   }
>>>
>>> }
>>>
>>>   }
>>>
>>> }
>>>
>>> }
>>>
>>>
>>>
>>> I also checked the FINER logs
>>> for org.csanchez.jenkins.plugins.kubernetes and it appears to be getting
>>> the settings:
>>>
>>>
>>> Combining pods, parent: Pod(apiVersion=v1, kind=Pod,
>>>> metadata=ObjectMeta(annotations=null, clusterName=null,
>>>> creationTimestamp=null, deletionGracePeriodSeconds=null,
>>>> deletionTimestamp=null, finalizers=[], generateName=null, generation=null,
>>>> labels={slave=jenkins-slave-testing-build}, managedFields=[], name=null,
>>>> namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null,
>>>> uid=null, additionalProperties={}), spec=PodSpec(
>>>> *activeDeadlineSeconds=3600*, affinity=null,
>>>> automountServiceAccountToken=null, containers=[Container(args=[],
>>>> command=[cat], env=[], envFrom=[], image=/jenkins-slave,
>>>> imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=slave,
>>>> ports=[], readinessProbe=null, resources=null, securityContext=null,
>>>> stdin=null, stdinOnce=null, terminationMessagePath=null,
>>>> terminationMessagePolicy=null, tty=true, volumeDevices=[],
>>>> volumeMounts=[VolumeMount(mountPath=null, mountPropagation=null,
>>>> name=docker-sock, readOnly=null, subPath=null, subPathExpr=null,
>>>> additionalProperties={})], workingDir=null, additionalProperties={})],
>>>> dns

Re: Jenkins Kubernetes Plugin not honoring activeDeadlineSeconds parameter

2019-10-18 Thread drpm
Hello, 

Thank you for your reply. 

It says here (https://github.com/jenkinsci/kubernetes-plugin) that pod will 
be deleted after the set activeDeadlineSeconds is passed or am I totally 
reading it wrong? 

   - podRetention Controls the behavior of keeping slave pods. Can be 
   'never()', 'onFailure()', 'always()', or 'default()' - if empty will 
   default to deleting the pod after activeDeadlineSeconds has passed.
   - activeDeadlineSeconds If podRetention is set to 'never()' or 
   'onFailure()', pod is deleted after this deadline is passed.

If this is totally wrong, can you recommend a right way to retain a pod 
even if the job is finished using this plugin? 

On Friday, October 18, 2019 at 6:17:06 PM UTC+9, Carlos Sanchez wrote:
>
> the plugin will delete the kubernetes pod after the jenkins job is 
> completed
>
> Also I don't think activeDeadlineSeconds is what you want
> activeDeadlineSeconds: Optional duration in seconds the pod may be active 
> on the node relative to StartTime before the system will actively try to 
> mark it failed and kill associated containers. Value must be a positive 
> integer.
>
>
> On Fri, Oct 18, 2019 at 11:11 AM drpm > 
> wrote:
>
>> Hello,
>>
>> For some reason, jenkins is not honoring *activeDeadlineSeconds* 
>> parameter when used in pipeline script. I'm using this kubernetes plugin 
>> for jenkins: https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin 
>>
>> *Sample Pipeline Script*: 
>>
>>
>> def label = "jenkins-test-build-${UUID.randomUUID().toString()}"
>>
>> podTemplate(label: label, yaml: """
>>
>> apiVersion: v1
>>
>> kind: Pod
>>
>> metadata:
>>
>>   labels:
>>
>> slave: jenkins-slave-testing-build
>>
>> spec:
>>
>>   activeDeadlineSeconds: 3600
>>
>>   containers:
>>
>>   - name: slave
>>
>> image: '/jenkins-slave'
>>
>> tty: true
>>
>> command:
>>
>> - cat
>>
>>   nodeSelector:
>>
>> xyz.com/app: cibuild
>>
>>   tolerations:
>>
>>   - effect: NoSchedule
>>
>> key: xyz.com/abc.xyz.com
>>
>> operator: Equal
>>
>> value: cibuild
>>
>> """
>>
>> ){
>>
>> node (label) {
>>
>>   withEnv(['USER=jenkins']) {
>>
>> container('slave') {
>>
>>   stage("test") {
>>
>> sh "echo test"
>>
>>   }
>>
>> }
>>
>>   }
>>
>> }
>>
>> }
>>
>>
>>
>> I also checked the FINER logs for org.csanchez.jenkins.plugins.kubernetes 
>> and it appears to be getting the settings:
>>
>>
>> Combining pods, parent: Pod(apiVersion=v1, kind=Pod, 
>>> metadata=ObjectMeta(annotations=null, clusterName=null, 
>>> creationTimestamp=null, deletionGracePeriodSeconds=null, 
>>> deletionTimestamp=null, finalizers=[], generateName=null, generation=null, 
>>> labels={slave=jenkins-slave-testing-build}, managedFields=[], name=null, 
>>> namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null, 
>>> uid=null, additionalProperties={}), spec=PodSpec(
>>> *activeDeadlineSeconds=3600*, affinity=null, 
>>> automountServiceAccountToken=null, containers=[Container(args=[], 
>>> command=[cat], env=[], envFrom=[], image=/jenkins-slave, 
>>> imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=slave, 
>>> ports=[], readinessProbe=null, resources=null, securityContext=null, 
>>> stdin=null, stdinOnce=null, terminationMessagePath=null, 
>>> terminationMessagePolicy=null, tty=true, volumeDevices=[], 
>>> volumeMounts=[VolumeMount(mountPath=null, mountPropagation=null, 
>>> name=docker-sock, readOnly=null, subPath=null, subPathExpr=null, 
>>> additionalProperties={})], workingDir=null, additionalProperties={})], 
>>> dnsConfig=null, dnsPolicy=null, enableServiceLinks=null, hostAliases=[], 
>>> hostIPC=null, hostNetwork=null, hostPID=null, hostname=null, 
>>> imagePullSecrets=[], initContainers=[], nodeName=null, nodeSelector={
>>> xyz.com/app=cibuild}, preemptionPolicy=null, priority=null, 
>>> priorityClassName=null, readinessGates=[], restartPolicy=null, 
>>> runtimeClassName=null, schedulerName=null, securityContext=null, 
>>> serviceAccount=null, serviceAccountName=null, shareProcessNamespace=null, 
>>> subdomain=null, terminationGracePeriodSeconds=null, 
>>> tolerations

Re: Jenkins Kubernetes Plugin not honoring activeDeadlineSeconds parameter

2019-10-18 Thread Carlos Sanchez
the plugin will delete the kubernetes pod after the jenkins job is completed

Also I don't think activeDeadlineSeconds is what you want
activeDeadlineSeconds: Optional duration in seconds the pod may be active
on the node relative to StartTime before the system will actively try to
mark it failed and kill associated containers. Value must be a positive
integer.


On Fri, Oct 18, 2019 at 11:11 AM drpm  wrote:

> Hello,
>
> For some reason, jenkins is not honoring *activeDeadlineSeconds*
> parameter when used in pipeline script. I'm using this kubernetes plugin
> for jenkins: https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin
>
> *Sample Pipeline Script*:
>
>
> def label = "jenkins-test-build-${UUID.randomUUID().toString()}"
>
> podTemplate(label: label, yaml: """
>
> apiVersion: v1
>
> kind: Pod
>
> metadata:
>
>   labels:
>
> slave: jenkins-slave-testing-build
>
> spec:
>
>   activeDeadlineSeconds: 3600
>
>   containers:
>
>   - name: slave
>
> image: '/jenkins-slave'
>
> tty: true
>
> command:
>
> - cat
>
>   nodeSelector:
>
> xyz.com/app: cibuild
>
>   tolerations:
>
>   - effect: NoSchedule
>
> key: xyz.com/abc.xyz.com
>
> operator: Equal
>
> value: cibuild
>
> """
>
> ){
>
> node (label) {
>
>   withEnv(['USER=jenkins']) {
>
> container('slave') {
>
>   stage("test") {
>
> sh "echo test"
>
>   }
>
> }
>
>   }
>
> }
>
> }
>
>
>
> I also checked the FINER logs for org.csanchez.jenkins.plugins.kubernetes
> and it appears to be getting the settings:
>
>
> Combining pods, parent: Pod(apiVersion=v1, kind=Pod,
>> metadata=ObjectMeta(annotations=null, clusterName=null,
>> creationTimestamp=null, deletionGracePeriodSeconds=null,
>> deletionTimestamp=null, finalizers=[], generateName=null, generation=null,
>> labels={slave=jenkins-slave-testing-build}, managedFields=[], name=null,
>> namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null,
>> uid=null, additionalProperties={}), spec=PodSpec(
>> *activeDeadlineSeconds=3600*, affinity=null,
>> automountServiceAccountToken=null, containers=[Container(args=[],
>> command=[cat], env=[], envFrom=[], image=/jenkins-slave,
>> imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=slave,
>> ports=[], readinessProbe=null, resources=null, securityContext=null,
>> stdin=null, stdinOnce=null, terminationMessagePath=null,
>> terminationMessagePolicy=null, tty=true, volumeDevices=[],
>> volumeMounts=[VolumeMount(mountPath=null, mountPropagation=null,
>> name=docker-sock, readOnly=null, subPath=null, subPathExpr=null,
>> additionalProperties={})], workingDir=null, additionalProperties={})],
>> dnsConfig=null, dnsPolicy=null, enableServiceLinks=null, hostAliases=[],
>> hostIPC=null, hostNetwork=null, hostPID=null, hostname=null,
>> imagePullSecrets=[], initContainers=[], nodeName=null, nodeSelector={
>> xyz.com/app=cibuild}, preemptionPolicy=null, priority=null,
>> priorityClassName=null, readinessGates=[], restartPolicy=null,
>> runtimeClassName=null, schedulerName=null, securityContext=null,
>> serviceAccount=null, serviceAccountName=null, shareProcessNamespace=null,
>> subdomain=null, terminationGracePeriodSeconds=null,
>> tolerations=[Toleration(effect=NoSchedule, key=xyz.com/abc.xyz.com,
>> operator=Equal, tolerationSeconds=null, value=cibuild,
>> additionalProperties={})], volumes=[Volume(awsElasticBlockStore=null,
>> azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null,
>> csi=null, downwardAPI=null, emptyDir=null, fc=null, flexVolume=null,
>> flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null,
>> hostPath=null, iscsi=null, name=null, nfs=null, persistentVolumeClaim=null,
>> photonPersistentDisk=null, portworxVolume=null, projected=null,
>> quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null,
>> vsphereVolume=null, additionalProperties={})],
>> additionalProperties={idleMinutes=null}), status=null,
>> additionalProperties={})
>
>
>
> but it's not working as expected since the pod is terminated right after
> the job is finished instead of waiting 3600s.
>
> Oct 18, 2019 8:58:18 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution$PodTemplateCallback
>> finished
>> Removing pod template
>> jenkins-test-build-87928862-54e0-44c3-9be4-c68d414d4427-w9jpl from cloud
>> kubernetes
>> Oct 18, 201

Jenkins Kubernetes Plugin not honoring activeDeadlineSeconds parameter

2019-10-18 Thread drpm
Hello,

For some reason, jenkins is not honoring *activeDeadlineSeconds* parameter 
when used in pipeline script. I'm using this kubernetes plugin for jenkins: 
https://wiki.jenkins.io/display/JENKINS/Kubernetes+Plugin 

*Sample Pipeline Script*: 


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

podTemplate(label: label, yaml: """

apiVersion: v1

kind: Pod

metadata:

  labels:

slave: jenkins-slave-testing-build

spec:

  activeDeadlineSeconds: 3600

  containers:

  - name: slave

image: '/jenkins-slave'

tty: true

command:

- cat

  nodeSelector:

xyz.com/app: cibuild

  tolerations:

  - effect: NoSchedule

key: xyz.com/abc.xyz.com

operator: Equal

value: cibuild

"""

){

node (label) {

  withEnv(['USER=jenkins']) {

container('slave') {

  stage("test") {

sh "echo test"

  }

}

  }

}

}



I also checked the FINER logs for org.csanchez.jenkins.plugins.kubernetes 
and it appears to be getting the settings:


Combining pods, parent: Pod(apiVersion=v1, kind=Pod, 
> metadata=ObjectMeta(annotations=null, clusterName=null, 
> creationTimestamp=null, deletionGracePeriodSeconds=null, 
> deletionTimestamp=null, finalizers=[], generateName=null, generation=null, 
> labels={slave=jenkins-slave-testing-build}, managedFields=[], name=null, 
> namespace=null, ownerReferences=[], resourceVersion=null, selfLink=null, 
> uid=null, additionalProperties={}), spec=PodSpec(
> *activeDeadlineSeconds=3600*, affinity=null, 
> automountServiceAccountToken=null, containers=[Container(args=[], 
> command=[cat], env=[], envFrom=[], image=/jenkins-slave, 
> imagePullPolicy=null, lifecycle=null, livenessProbe=null, name=slave, 
> ports=[], readinessProbe=null, resources=null, securityContext=null, 
> stdin=null, stdinOnce=null, terminationMessagePath=null, 
> terminationMessagePolicy=null, tty=true, volumeDevices=[], 
> volumeMounts=[VolumeMount(mountPath=null, mountPropagation=null, 
> name=docker-sock, readOnly=null, subPath=null, subPathExpr=null, 
> additionalProperties={})], workingDir=null, additionalProperties={})], 
> dnsConfig=null, dnsPolicy=null, enableServiceLinks=null, hostAliases=[], 
> hostIPC=null, hostNetwork=null, hostPID=null, hostname=null, 
> imagePullSecrets=[], initContainers=[], nodeName=null, 
> nodeSelector={xyz.com/app=cibuild}, preemptionPolicy=null, priority=null, 
> priorityClassName=null, readinessGates=[], restartPolicy=null, 
> runtimeClassName=null, schedulerName=null, securityContext=null, 
> serviceAccount=null, serviceAccountName=null, shareProcessNamespace=null, 
> subdomain=null, terminationGracePeriodSeconds=null, 
> tolerations=[Toleration(effect=NoSchedule, key=xyz.com/abc.xyz.com, 
> operator=Equal, tolerationSeconds=null, value=cibuild, 
> additionalProperties={})], volumes=[Volume(awsElasticBlockStore=null, 
> azureDisk=null, azureFile=null, cephfs=null, cinder=null, configMap=null, 
> csi=null, downwardAPI=null, emptyDir=null, fc=null, flexVolume=null, 
> flocker=null, gcePersistentDisk=null, gitRepo=null, glusterfs=null, 
> hostPath=null, iscsi=null, name=null, nfs=null, persistentVolumeClaim=null, 
> photonPersistentDisk=null, portworxVolume=null, projected=null, 
> quobyte=null, rbd=null, scaleIO=null, secret=null, storageos=null, 
> vsphereVolume=null, additionalProperties={})], 
> additionalProperties={idleMinutes=null}), status=null, 
> additionalProperties={})


 
but it's not working as expected since the pod is terminated right after 
the job is finished instead of waiting 3600s.

Oct 18, 2019 8:58:18 AM INFO 
org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution$PodTemplateCallback
 
> finished
> Removing pod template 
> jenkins-test-build-87928862-54e0-44c3-9be4-c68d414d4427-w9jpl from cloud 
> kubernetes
> Oct 18, 2019 8:58:18 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.pod.retention.Reaper 
> eventReceived
> cibuild/jenkins-test-build-87928862-54e0-44c3-9be4-c68d414d44-d2878 was 
> just deleted, so removing corresponding Jenkins agent
> Oct 18, 2019 8:58:18 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave 
> deleteSlavePod
> Terminated Kubernetes instance for agent 
> cibuild/jenkins-mbx-test-build-87928862-54e0-44c3-9be4-c68d414d44-d2878
> Oct 18, 2019 8:58:18 AM INFO 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave 
> _terminate
> Disconnected computer 
> jenkins-test-build-87928862-54e0-44c3-9be4-c68d414d44-d2878



Thank you in advance for your help. 

- drpm 

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/fd798b7c-39cf-41f4-b99b-8ebd5067dd6e%40googlegroups.com.


[Jenkins Kubernetes Plugin] Issues building plugin from source

2019-10-17 Thread 'Andrew Douglas' via Jenkins Users
Hi, I am trying to diagnose a potential issue with this plugin and have 
downloaded the source (from https://github.com/jenkinsci/kubernetes-plugin).

I am running Minikube and have the latest version of Maven. When I try to 
build the plugin with the command `mvn clean install 
-DconnectorHost=0.0.0.0` I always get at least one integration test failure 
and then the build fails. Failures typically look like:

```
[INFO] Running 
org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
[ERROR] Tests run: 27, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 
592.425 s <<< FAILURE! - in 
org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest
[ERROR] 
cascadingDelete(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
  
Time elapsed: 180.127 s  <<< ERROR!
org.junit.runners.model.TestTimedOutException: test timed out after 180 
seconds
at java.base@12.0.1/java.lang.Thread.sleep(Native Method)
at 
app//org.jvnet.hudson.test.JenkinsRule.waitForCompletion(JenkinsRule.java:1430)
at 
app//org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest.cascadingDelete(KubernetesPipelineTest.java:404)
at 
java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
at 
java.base@12.0.1/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at 
java.base@12.0.1/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base@12.0.1/java.lang.reflect.Method.invoke(Method.java:567)
at 
app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at 
app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at 
app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at 
app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at 
app//org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at 
app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at 
app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at 
app//org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
at app//org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at 
app//org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:600)
at 
app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at 
app//org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at 
java.base@12.0.1/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base@12.0.1/java.lang.Thread.run(Thread.java:835)

[ERROR] 
computerCantBeConfigured(org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesPipelineTest)
  
Time elapsed: 0.493 s  <<< ERROR!
org.jvnet.hudson.reactor.ReactorException: java.lang.Error: 
java.lang.reflect.InvocationTargetException
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1152)
at jenkins.model.Jenkins.(Jenkins.java:959)
at hudson.model.Hudson.(Hudson.java:85)
at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:675)
at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:402)
at 
org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:595)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at 
org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at 
java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
at 
hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
at jenkins.model.Jenkins$5.runTask(Jenkins.java:1118)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor93.invoke(Unknown 
Source)
at 
java.base/jdk.internal.reflect.Delegati

Re: Kubernetes plugin cannot start POD´s due to PVC creation error

2019-10-17 Thread Torsten Reinhard
I´ve enabled a "kubernetes" Logger with Level.FINEST and got this output:

Combining pod templates, parent: PodTemplate{inheritFrom='', name='default', 
namespace='', label='', nodeSelector='', nodeUsageMode=EXCLUSIVE, 
workspaceVolume=org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.
DynamicPVCWorkspaceVolume@79ebc880, containers=[ContainerTemplate{name=
'main', image=
'docker-registry-default.cnap-00-mp-prod.mycompanygroup.net:443/jenkins-slave/base:latest'
, workingDir='/home/jenkins/agent', command='/bin/sh -c', args='cat', 
resourceRequestCpu='', resourceRequestMemory='', resourceLimitCpu='', 
resourceLimitMemory='', livenessProbe=org.csanchez.jenkins.plugins.
kubernetes.ContainerLivenessProbe@16be1b19}]} Oct 17, 2019 1:55:40 PM 
FINEST org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils
Combining pod templates, template: PodTemplate{, name=
'9ccd91fa-0aba-46d6-b493-f48fb4136a68-60m1x', label=
'9ccd91fa-0aba-46d6-b493-f48fb4136a68', nodeUsageMode=EXCLUSIVE, containers
=[ContainerTemplate{name='main', image=
'docker-registry-default.cnap-00-mp-prod.mycompanygroup.net:443/ci-next/jenkins-slave-java8-mvn:latest'
, alwaysPullImage=true, command='/bin/sh -c', args='cat', ttyEnabled=true, 
envVars=[KeyValueEnvVar [getValue()=https://rspsales-cinext.mycompanygroup.net, 
getKey()=LOCAL_URL], KeyValueEnvVar 
[getValue()=https://rspsales-cinext.mycompanygroup.net/nexus, 
getKey()=NEXUS_URL]]}], 
annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@9d4da4a8, 
org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821]}

Oct 17, 2019 1:55:40 PM FINEST org.csanchez.jenkins.plugins.kubernetes.
PodTemplateUtils
Pod templates combined: PodTemplate{inheritFrom='', name=
'9ccd91fa-0aba-46d6-b493-f48fb4136a68-60m1x', namespace='', label=
'9ccd91fa-0aba-46d6-b493-f48fb4136a68', nodeSelector='', nodeUsageMode=
EXCLUSIVE, workspaceVolume=org.csanchez.jenkins.plugins.kubernetes.volumes.
workspace.DynamicPVCWorkspaceVolume@79ebc880, containers=[ContainerTemplate{
name='main', image=
'docker-registry-default.cnap-00-mp-prod.mycompanygroup.net:443/ci-next/jenkins-slave-java8-mvn:latest'
, alwaysPullImage=true, workingDir='/home/jenkins/agent', command='/bin/sh 
-c', args='cat', ttyEnabled=true, resourceRequestCpu='', 
resourceRequestMemory='', resourceLimitCpu='', resourceLimitMemory='', 
envVars=[KeyValueEnvVar [getValue()=https://rspsales-cinext.mycompanygroup.net, 
getKey()=LOCAL_URL], KeyValueEnvVar 
[getValue()=https://rspsales-cinext.mycompanygroup.net/nexus, 
getKey()=NEXUS_URL]]}], 
annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@9d4da4a8, 
org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821], yamls=


I´m wondering why the parent PodTemplate has 
workspaceVolume=DynamicPVCWorkspaceVolume? 
Is this the new default?

I´ll try to enable a custom Workspace (EmptyDir) in Kubernetes plugin 
configuration - which should prevent from creation of DynamicPVC´s causing the 
error.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8829441d-c93e-4546-bee2-b9d7358c7ebf%40googlegroups.com.


Kubernetes plugin cannot start POD´s due to PVC creation error

2019-10-17 Thread Torsten Reinhard
Hi, 

I´m running Jenkins Version 2.190.1 in an openShift 3.9 Cluster, Kubernetes 
plugin is at version 1.19.3

Since one of the last updates, I sometimes run into:

 [id=1597]WARNINGo.c.j.p.k.KubernetesLauncher#launch: Error in 
provisioning; agent=KubernetesSlave name: 
b4dbc13f-6f01-42d5-a9d7-b31e9520adaa-7013x-lcc2j, 
 template=PodTemplate{inheritFrom='', 
 name='b4dbc13f-6f01-42d5-a9d7-b31e9520adaa-7013x', 
 namespace='', 
 label='b4dbc13f-6f01-42d5-a9d7-b31e9520adaa', 
 nodeSelector='', 
 nodeUsageMode=EXCLUSIVE, 
 workspaceVolume=org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.
DynamicPVCWorkspaceVolume@79ebc880, 
 containers=[ContainerTemplate{name='main', image=
'docker-registry-default.cnap-00-mp-prod.mycompanygroup.net:443/ci-next/jenkins-slave-oc:latest'
, 
 alwaysPullImage=true, workingDir='/home/jenkins/agent', command='/bin/sh 
-c', args='cat', ttyEnabled=true, resourceRequestCpu='', 
 resourceRequestMemory='', 
 resourceLimitCpu='', 
 resourceLimitMemory='', 
 envVars=[KeyValueEnvVar [getValue()=https://rspsales-cinext.mycompanygroup.net 
, getKey()=LOCAL_URL], 
 KeyValueEnvVar [getValue()=https://rspsales-cinext.mycompanygroup.net/nexus 
, getKey()=NEXUS_URL], 
 KeyValueEnvVar [getValue()=default, getKey()=clusterName], 
 KeyValueEnvVar [getValue()=rspsales-ci, getKey()=project], 
 KeyValueEnvVar [getValue()=BuildConfig.yml, getKey()=buildConfigFile]]}], 
 annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@9d4da4a8
, org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821], yamls=[
apiVersion: v1
kind: Pod
metadata:
labels:
tier: ci
cinextProject: null
app: jenkins-slave
spec:
  containers:
  - name: jnlp
image: 'jenkins/jnlp-slave:alpine'
args: ['$(JENKINS_SECRET)', '$(JENKINS_NAME)']
resources:
  limits:
cpu: '200m'
memory: '256Mi'
  requests:
cpu: '200m'
memory: '128Mi'
env:
  - name: JAVA_OPTS
value: '-Xmx128m'
]}
io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: 
POST at: 
https://10.221.128.1/api/v1/namespaces/rspsales-ci/persistentvolumeclaims 
. Message: Forbidden!Configured service account doesn't have access. 
Service account may have been revoked. persistentvolumeclaims 
"pvc-b4dbc13f-6f01-42d5-a9d7-b31e9520adaa-7013x-lcc2j" is forbidden: cannot 
set blockOwnerDeletion if an ownerReference refers to a resource you can't 
set finalizers on: User "system:serviceaccount:rspsales-ci:jenkins" cannot 
update pods/finalizers in project "rspsales-ci", .
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure
(OperationSupport.java:510)
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.
assertResponseCode(OperationSupport.java:447)
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse
(OperationSupport.java:413)
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse
(OperationSupport.java:372)
at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleCreate(
OperationSupport.java:241)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.handleCreate(
BaseOperation.java:813)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(
BaseOperation.java:328)
at io.fabric8.kubernetes.client.dsl.base.BaseOperation.create(
BaseOperation.java:324)
at org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.
DynamicPVCWorkspaceVolume.createVolume(DynamicPVCWorkspaceVolume.java:94)
at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(
KubernetesLauncher.java:130)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:297)
at jenkins.util.ContextResettingExecutorService$2.call(
ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(
ImpersonatingExecutorService.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
ja)va:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:624)
at java.lang.Thread.run(Thread.java:748)

I guess it´s related to the Dynamic PVC´s (see JENKINS-47591) introduced in 
1.19.2 - but how can this be resolved ?

The strange thing about it is that after restarting Jenkins the POD 
launching works several times - and than suddenly starts to fail with the 
above message.

I´m running Jenkins with a dedicated service-account:jenkins at openShift, 
having either "edit" or now for testing "admin" role.

Thanx for any ideas, 

Torsten

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/

[Jenkins Kubernetes Plugin] Handshake Error

2019-10-07 Thread Nadir Mouhoubi
Hello,

Recently, we moved our Kubernetes Cluster to another on prem datacenter 
located in another geographical site with acceptable network latencies.

On our Jenkins build platform, we are facing *random*  SSL Handshake error 
with the exception bellow :

2019-10-07 13:36:33,109 [INFO] 


2019-10-07 13:36:33,110 [INFO] BUILD SUCCESS

2019-10-07 13:36:33,110 [INFO] 


2019-10-07 13:36:33,110 [INFO] Total time: 09:44 min

2019-10-07 13:36:33,110 [INFO] Finished at: 2019-10-07T13:36:33+02:00

2019-10-07 13:36:33,111 [INFO] 


[Pipeline] }

Xvfb stopping

Killing processes

[Pipeline] // wrap

[Pipeline] }

[Pipeline] // container

[Pipeline] }

[Pipeline] // stage

[Pipeline] }

[Pipeline] // withEnv

[Pipeline] }

[Pipeline] // node

[Pipeline] }

[Pipeline] // podTemplate

[Pipeline] End of Pipeline

[Bitbucket] Notifying commit build result

[Bitbucket] Build result notified

java.io.EOFException: SSL peer shut down incorrectly

at sun.security.ssl.InputRecord.read(InputRecord.java:505)

at 
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)

Caused: javax.net.ssl.SSLHandshakeException: Remote host closed connection 
during handshake

at 
sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:992)

at 
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)

at 
sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)

at 
okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:299)

at 
okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:268)

at 
okhttp3.internal.connection.RealConnection.connect(RealConnection.java:160)

at 
okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:256)

at 
okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:134)

at 
okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:113)

at 
okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
io.fabric8.kubernetes.client.utils.BackwardsCompatibilityInterceptor.intercept(BackwardsCompatibilityInterceptor.java:119)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
io.fabric8.kubernetes.client.utils.ImpersonatorInterceptor.intercept(ImpersonatorInterceptor.java:68)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
io.fabric8.kubernetes.client.utils.HttpClientUtils$2.intercept(HttpClientUtils.java:104)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

at 
okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

at 
okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)

at okhttp3.RealCall.execute(RealCall.java:77)

at 
io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:379)

at 
io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:344)

at 

[kubernetes plugin] compatibility matrix.

2019-10-07 Thread Nadir Mouhoubi
Bonjour,


Is there any compatibility matrix between Jenkins, 
Jenkins-kubernetes-plugin and kubernetes version? or how can I found with 
version works with witch other ?


Thank you for your help.

Nadir.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/036785d7-75ad-4cce-841d-5c29930c944f%40googlegroups.com.


[Kubernetes plugin] Orphan nodes (pods) management.

2019-09-16 Thread Amel Mouhoubi
Hello,

For some extra reasons, we have dynamic slaves created with Jenkins 
Kubernetes plugins that loose connection with the master because the master 
is down.  Is there a way to parametrize jenkins remoting  (Jenkins 
kubernetes plugin)  to automatically delete these pods after a number of 
attempts to connect to the master ?

Thanks for your help.

Nadir.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3e37b66c-b653-40e9-a02d-733801b62097%40googlegroups.com.


Re: Kubernetes plugin and podtemplate in declarative pipeline

2019-09-12 Thread jado
I've tried that before with no luck, but it starts to work finally - you 
don't define kubernetes template in the agent section, but reference to 
created one by the label assigned to it: 

> pipeline {
> agent {
> label 'buildslave'
> }
>
>
W dniu środa, 11 września 2019 15:25:00 UTC+2 użytkownik jado napisał:
>
> Hi, 
> I'm using Jenkins 2.176.2 and Kubernetes Plugin 1.18.1. 
> I defined PodTemplate via GUI with RawYaml definition and i would like to 
> use this in my declarative pipeline:
>
> pipeline {
>> agent {
>> kubernetes {
>> cloud 'mycloud'
>> defaultContainer 'jnlp'
>> inheritFrom 'my-buildslave'
>> }
>> }
>>
>
>  However pipeline execution stucks here:
>
>> Still waiting to schedule task
>> All nodes of label 'run-jenkins-buildslave-on-kube_84-7gg7p’ are offline
>>
>>
> Pod is not being created on k8s. 
> When i add any yaml definition as below:
>
>
>> pipeline {
>> agent {
>> kubernetes {
>> cloud 'mycloud'
>> defaultContainer 'jnlp'
>> inheritFrom 'my-buildslave'
>> yaml """
>> spec:
>> containers:
>> - name: golang
>> image: golang:1.6.3-alpine
>> command:
>> - cat
>> tty: true
>> """
>> }
>> }
>>
>  
> Then POD has been started but it doesn't inherit from pod template - it 
> runs 2 containers: jnlp and golang. How to use inheritance or some other 
> mechanism so i dont need to define my pod in each pipeline?
>
> My Kubernetes Pod template raw definition:
>
>> spec:  
>>   imagePullSecrets:
>>   - name: mysec
>>   containers:
>>   - name: maven   
>>  
>> image: maven:latest  
>> imagePullPolicy: Always   
>>  
>> command: 
>>
>> - cat 
>>  
>> tty: true
>> env:
>> - name: DOCKER_HOST
>>   value: tcp://localhost:2375
>> resources: {}
>>  
>>   - name: dind
>> image: docker:18.05-dind
>> securityContext:
>>   privileged: true
>> volumeMounts:
>> - name: dind-storage
>>   mountPath: /var/lib/docker
>> resources: {} 
>>
>>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3ca074ce-6ce1-47f0-b84a-fee101bd31f9%40googlegroups.com.


Kubernetes plugin and podtemplate in declarative pipeline

2019-09-11 Thread jado
Hi, 
I'm using Jenkins 2.176.2 and Kubernetes Plugin 1.18.1. 
I defined PodTemplate via GUI with RawYaml definition and i would like to 
use this in my declarative pipeline:

pipeline {
> agent {
> kubernetes {
> cloud 'mycloud'
> defaultContainer 'jnlp'
> inheritFrom 'my-buildslave'
> }
> }
>

 However pipeline execution stucks here:

> Still waiting to schedule task
> All nodes of label 'run-jenkins-buildslave-on-kube_84-7gg7p’ are offline
>
>
Pod is not being created on k8s. 
When i add any yaml definition as below:


> pipeline {
> agent {
> kubernetes {
> cloud 'mycloud'
> defaultContainer 'jnlp'
> inheritFrom 'my-buildslave'
> yaml """
> spec:
> containers:
> - name: golang
> image: golang:1.6.3-alpine
> command:
> - cat
> tty: true
> """
> }
> }
>
 
Then POD has been started but it doesn't inherit from pod template - it 
runs 2 containers: jnlp and golang. How to use inheritance or some other 
mechanism so i dont need to define my pod in each pipeline?

My Kubernetes Pod template raw definition:

> spec:  
>   imagePullSecrets:
>   - name: mysec
>   containers:
>   - name: maven   
>  
> image: maven:latest  
> imagePullPolicy: Always   
>  
> command:   
>  
> - cat 
>  
> tty: true
> env:
> - name: DOCKER_HOST
>   value: tcp://localhost:2375
> resources: {}
>  
>   - name: dind
> image: docker:18.05-dind
> securityContext:
>   privileged: true
> volumeMounts:
> - name: dind-storage
>   mountPath: /var/lib/docker
> resources: {} 
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/64ba286e-ce44-49fb-8142-a0bb787d3137%40googlegroups.com.


Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2019-09-09 Thread Sardar Junaid Mukhtar
Hi Carlos

I have upgraded the plugin to the latest version 1.18.3 and we are still 
hitting the same issue but with a slightly different error message. 

Any chance that you can look into this?

Thanks,
Junaid

On Friday, December 14, 2018 at 1:08:55 PM UTC, Simon Young wrote:
>
> Unfortunately it's not fixed in 1.13.8. We now see this:
>
> Connection was rejected, you should increase the Max connections to 
> Kubernetes API
>
> I tried increasing Max connections to 400. The next build passed, but 
> subsequent builds are failing, just like we saw with 1.13.7.
>
> I have to roll back to 1.13.5.
>
>
>
> On Friday, December 14, 2018 at 11:39:59 AM UTC, Carlos Sanchez wrote:
>>
>> This should be fixed in 1.13.8
>>
>> On Fri, Dec 14, 2018, 08:31 Simon Young  
>> wrote:
>>
>>> Hi Carlos,
>>>
>>> Rolling back to 1.13.5 seems to have fixed the issue. I can now run 
>>> multiple consecutive builds and they all pass.
>>>
>>> I'm a bit concerned that we're unable to upgrade to the latest version 
>>> though - Do you have enough information to identify the problem?
>>>
>>> Thanks,
>>>
>>> Simon.
>>>
>>> -- 
>>> 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/139429ab-498d-44c4-9c96-955075cbbfb3%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8b668b0d-4622-44b0-8fc7-75ccafb51c91%40googlegroups.com.


Re: Jenkins Kubernetes plugin credentials for Google Kubernetes Engine cluster

2019-06-21 Thread Carlos Sanchez
No, that's google service accounts. You want to check Kubernetes service
accounts
For instance https://devopscube.com/kubernetes-api-access-service-account/


On Fri, Jun 21, 2019 at 8:06 PM samt88  wrote:

> Thanks Carlos. I have searched the google for "google cloud service
> account token secret string" and I get some hits such as this page:
> https://cloud.google.com/iam/docs/creating-managing-service-account-keys
>
> Is this the right place to start? Do you happen to know if there is a page
> that explains the step by step procedure?
> I am not familiar with issues surrounding tokens and secret strings. I am
> sure my question also helps others who would like to setup Jenkins on
> Google cloud without using helm or other utilities. Thanks.
>
> On Wednesday, June 19, 2019 at 4:55:54 AM UTC-7, Carlos Sanchez wrote:
>>
>> you can create certificate credentials too, but the best way is to use a
>> service account token (secret string)
>>
>> On Tue, Jun 18, 2019 at 11:51 PM samt88  wrote:
>>
>>> I need to setup the Jenkins Kubernetes plugin to fire off slaves on
>>> demand. The top portion of the plugin requires us to provide two important
>>> values to the plugin. One is the value for the "Kubernetes  URL" field and
>>> the other is the value for the "Credentials" field. By providing these two
>>> values and clicking on the "Test Connection" button we should be able to
>>> verify that Jenkins can successfully connect to the cluster.
>>>
>>> The Google Kubernetes Engine does not provide a username/password for
>>> cluster by default anymore.  The GKE page where we see the cluster
>>> credentials specifically says "Basic authentication for this cluster is
>>> disabled". I only see the value for "Cluster CA certificate" on this
>>> page.  Does anyone have the step by step instructions on how I can use
>>> this certificate to configure the "Credentials" field of the Jenkins
>>> Kubernetes plugin to connect to the cluster? I have tried a few
>>> combinations but I have not been successful so far. 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 jenkins...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/bbf1590d-2cd7-469f-99f1-56f6c87e478c%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/bbf1590d-2cd7-469f-99f1-56f6c87e478c%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Oq89-h%3DNRfYOydB3HmLSEKV4rorCLNQeZ-OO%2B9DVBtHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Kubernetes plugin credentials for Google Kubernetes Engine cluster

2019-06-21 Thread samt88
Thanks Carlos. I have searched the google for "google cloud service account 
token secret string" and I get some hits such as this page:
https://cloud.google.com/iam/docs/creating-managing-service-account-keys

Is this the right place to start? Do you happen to know if there is a page 
that explains the step by step procedure? 
I am not familiar with issues surrounding tokens and secret strings. I am 
sure my question also helps others who would like to setup Jenkins on 
Google cloud without using helm or other utilities. Thanks.

On Wednesday, June 19, 2019 at 4:55:54 AM UTC-7, Carlos Sanchez wrote:
>
> you can create certificate credentials too, but the best way is to use a 
> service account token (secret string)
>
> On Tue, Jun 18, 2019 at 11:51 PM samt88 > 
> wrote:
>
>> I need to setup the Jenkins Kubernetes plugin to fire off slaves on 
>> demand. The top portion of the plugin requires us to provide two important 
>> values to the plugin. One is the value for the "Kubernetes  URL" field and 
>> the other is the value for the "Credentials" field. By providing these two 
>> values and clicking on the "Test Connection" button we should be able to 
>> verify that Jenkins can successfully connect to the cluster.
>>
>> The Google Kubernetes Engine does not provide a username/password for 
>> cluster by default anymore.  The GKE page where we see the cluster 
>> credentials specifically says "Basic authentication for this cluster is 
>> disabled". I only see the value for "Cluster CA certificate" on this 
>> page.  Does anyone have the step by step instructions on how I can use 
>> this certificate to configure the "Credentials" field of the Jenkins 
>> Kubernetes plugin to connect to the cluster? I have tried a few 
>> combinations but I have not been successful so far. 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 jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/bbf1590d-2cd7-469f-99f1-56f6c87e478c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Kubernetes plugin credentials for Google Kubernetes Engine cluster

2019-06-19 Thread Carlos Sanchez
you can create certificate credentials too, but the best way is to use a
service account token (secret string)

On Tue, Jun 18, 2019 at 11:51 PM samt88  wrote:

> I need to setup the Jenkins Kubernetes plugin to fire off slaves on
> demand. The top portion of the plugin requires us to provide two important
> values to the plugin. One is the value for the "Kubernetes  URL" field and
> the other is the value for the "Credentials" field. By providing these two
> values and clicking on the "Test Connection" button we should be able to
> verify that Jenkins can successfully connect to the cluster.
>
> The Google Kubernetes Engine does not provide a username/password for
> cluster by default anymore.  The GKE page where we see the cluster
> credentials specifically says "Basic authentication for this cluster is
> disabled". I only see the value for "Cluster CA certificate" on this
> page.  Does anyone have the step by step instructions on how I can use
> this certificate to configure the "Credentials" field of the Jenkins
> Kubernetes plugin to connect to the cluster? I have tried a few
> combinations but I have not been successful so far. 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Ph5sQd2sCO5GY9Ks-XpK%3D4FhtnzMC%3Dr35O1f14rFC9eA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins Kubernetes plugin credentials for Google Kubernetes Engine cluster

2019-06-18 Thread samt88
I need to setup the Jenkins Kubernetes plugin to fire off slaves on demand. 
The top portion of the plugin requires us to provide two important values 
to the plugin. One is the value for the "Kubernetes  URL" field and the 
other is the value for the "Credentials" field. By providing these two 
values and clicking on the "Test Connection" button we should be able to 
verify that Jenkins can successfully connect to the cluster.

The Google Kubernetes Engine does not provide a username/password for 
cluster by default anymore.  The GKE page where we see the cluster 
credentials specifically says "Basic authentication for this cluster is 
disabled". I only see the value for "Cluster CA certificate" on this page.  
Does 
anyone have the step by step instructions on how I can use this certificate 
to configure the "Credentials" field of the Jenkins Kubernetes plugin to 
connect to the cluster? I have tried a few combinations but I have not been 
successful so far. 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/1149bb3a-0063-4b0f-8376-8f5a0071a6f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - Service account authorization in Google Cloud

2019-05-16 Thread Carlos Sanchez
the right way for Kubernetes apps is to create a ServiceAccount

https://cloud.google.com/solutions/jenkins-on-kubernetes-engine
https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial
https://github.com/jenkinsci/kubernetes-plugin#running-in-google-container-engine-gke

On Wed, May 15, 2019 at 10:18 PM Jonas Lindström 
wrote:

> Hello,
>
> I am trying to use the Kubernetes plugin to start Jenkins agents in Google
> Kubernetes Engine. For server to server applications, Google recommends
> that you create a GCP service account and then generate a key file (JSON
> format) for this service account. The key file can then be used to generate
> short-lived tokens for kubectl.
>
> https://cloud.google.com/docs/authentication/production
>
> However, I have been unable to figure out from the documentation how to
> use this method of authentication with the Kubernetes plugin. I am using
> gcloud and kubectl commands to deploy applications to Google Kubernetes
> Engine, so I know that the service account itself has sufficient
> permissions. (Note that this is a GCP service account, not a kubectl
> serviceaccount.)
>
> I can retrieve the access token for a service account with
> gcloud auth application-default print-access-token
> but this token is short-lived and meant for debugging, so it's not very
> usable.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/8bc468cf-28aa-43e4-9504-435fc00b8691%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/8bc468cf-28aa-43e4-9504-435fc00b8691%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6MKRPUhbBLmwriey848zAkXdzYHDNnCq6%2BLgv8JAEJguw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes plugin - Service account authorization in Google Cloud

2019-05-15 Thread Jonas Lindström
Hello,

I am trying to use the Kubernetes plugin to start Jenkins agents in Google 
Kubernetes Engine. For server to server applications, Google recommends 
that you create a GCP service account and then generate a key file (JSON 
format) for this service account. The key file can then be used to generate 
short-lived tokens for kubectl.

https://cloud.google.com/docs/authentication/production

However, I have been unable to figure out from the documentation how to use 
this method of authentication with the Kubernetes plugin. I am using gcloud 
and kubectl commands to deploy applications to Google Kubernetes Engine, so 
I know that the service account itself has sufficient permissions. (Note 
that this is a GCP service account, not a kubectl serviceaccount.)

I can retrieve the access token for a service account with 
gcloud auth application-default print-access-token
but this token is short-lived and meant for debugging, so it's not very 
usable.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/8bc468cf-28aa-43e4-9504-435fc00b8691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-05-14 Thread Art
Hi Carlos,

I am running into this same issue when I try to run pods in parallel within 
the same job. As the number of pods launched by the job increases, the 
number of timeouts/disconnects increases.

See attached images for the failure details.

I believe it is the same issue.

Regards,
Art

On Thursday, April 25, 2019 at 9:39:36 AM UTC-7, Carlos Sanchez wrote:
>
> what flavor of kubernetes ? cloud? on prem? how was it built? what 
> networking is it using?
> there are a lot of variations so the best chance to find out is to relate 
> with other people's environment and try to isolate
>
> On Thu, Apr 25, 2019 at 6:36 PM Gopi > 
> wrote:
>
>> Hi
>> Using latest Kubernetes 1.13 with 3 master nodes.
>>
>> On Thu, Apr 25, 2019 at 2:15 PM Carlos Sanchez > > wrote:
>>
>>> what kubernetes cluster are you using and with what networking?
>>> my guess is that the underlying network layer is killing inactive 
>>> connections
>>>
>>> On Thu, Apr 25, 2019 at 4:24 AM Gopi Naidu >> > wrote:
>>>
>>>> I have got into the same issue. Could you please post the solution if 
>>>> anything is found?
>>>>
>>>> On Sunday, 26 August 2018 04:28:47 UTC+5:30, fabio...@singlepoint.ie 
>>>> wrote:
>>>>>
>>>>> I'm using Kubernetes plugin 1.12.3
>>>>>
>>>>> The plugin works well, but whenever the agent does streams the log to 
>>>>> the master, it causes a connection exception as follows.
>>>>> To reproduce, simply create a free style job, restrict to run on the 
>>>>> kubernetes pod, and add a step to sleep for 300 seconds.
>>>>>
>>>>>
>>>>> FATAL: command execution failed
>>>>> java.nio.channels.ClosedChannelException
>>>>>   at 
>>>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>>>>   at 
>>>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>>>>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>>>>   at 
>>>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>>>>   at 
>>>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>>>>   at 
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>>>>   at 
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>>>>   at java.lang.Thread.run(Thread.java:748)
>>>>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection 
>>>>> from ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
>>>>> disconnected.
>>>>>   at 
>>>>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>>>>   at 
>>>>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>>>>   at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>>>>>   at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>>>>>   at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>>>>>   at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>>>>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>>>>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>>>>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>>>>   at 
>>>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>>>>>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>>>>>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>>>>   at 
>>>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>>>>   at hudson.model.Run.execute(Run.java:1798)
>>>>>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>>>>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>>>>>   at hudson.model.Executor.run(Executor.java:429)
>>>>> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
>>>>> java.nio.channels.ClosedChannelException
>>>>>   at 
>>>>&g

Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-04-25 Thread Carlos Sanchez
what flavor of kubernetes ? cloud? on prem? how was it built? what
networking is it using?
there are a lot of variations so the best chance to find out is to relate
with other people's environment and try to isolate

On Thu, Apr 25, 2019 at 6:36 PM Gopi  wrote:

> Hi
> Using latest Kubernetes 1.13 with 3 master nodes.
>
> On Thu, Apr 25, 2019 at 2:15 PM Carlos Sanchez  wrote:
>
>> what kubernetes cluster are you using and with what networking?
>> my guess is that the underlying network layer is killing inactive
>> connections
>>
>> On Thu, Apr 25, 2019 at 4:24 AM Gopi Naidu  wrote:
>>
>>> I have got into the same issue. Could you please post the solution if
>>> anything is found?
>>>
>>> On Sunday, 26 August 2018 04:28:47 UTC+5:30, fabio...@singlepoint.ie
>>> wrote:
>>>>
>>>> I'm using Kubernetes plugin 1.12.3
>>>>
>>>> The plugin works well, but whenever the agent does streams the log to
>>>> the master, it causes a connection exception as follows.
>>>> To reproduce, simply create a free style job, restrict to run on the
>>>> kubernetes pod, and add a step to sleep for 300 seconds.
>>>>
>>>>
>>>> FATAL: command execution failed
>>>> java.nio.channels.ClosedChannelException
>>>>at 
>>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>>>at 
>>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>>>at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>>>at 
>>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>>>at 
>>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>>>at 
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>>>at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>>>at java.lang.Thread.run(Thread.java:748)
>>>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection 
>>>> from ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
>>>> disconnected.
>>>>at 
>>>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>>>at 
>>>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>>>at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>>>>at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>>>>at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>>>>at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>>>at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>>>at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>>>at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>>>at 
>>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>>>>at hudson.model.Build$BuildExecution.build(Build.java:206)
>>>>at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>>>at 
>>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>>>at hudson.model.Run.execute(Run.java:1798)
>>>>at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>>>at hudson.model.ResourceController.execute(ResourceController.java:97)
>>>>at hudson.model.Executor.run(Executor.java:429)
>>>> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
>>>> java.nio.channels.ClosedChannelException
>>>>at 
>>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>>>at 
>>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>>>at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>>>at 
>>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>>>at 
>>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>>>at 
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>

Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-04-25 Thread Gopi
Hi
Using latest Kubernetes 1.13 with 3 master nodes.

On Thu, Apr 25, 2019 at 2:15 PM Carlos Sanchez  wrote:

> what kubernetes cluster are you using and with what networking?
> my guess is that the underlying network layer is killing inactive
> connections
>
> On Thu, Apr 25, 2019 at 4:24 AM Gopi Naidu  wrote:
>
>> I have got into the same issue. Could you please post the solution if
>> anything is found?
>>
>> On Sunday, 26 August 2018 04:28:47 UTC+5:30, fabio...@singlepoint.ie
>> wrote:
>>>
>>> I'm using Kubernetes plugin 1.12.3
>>>
>>> The plugin works well, but whenever the agent does streams the log to
>>> the master, it causes a connection exception as follows.
>>> To reproduce, simply create a free style job, restrict to run on the
>>> kubernetes pod, and add a step to sleep for 300 seconds.
>>>
>>>
>>> FATAL: command execution failed
>>> java.nio.channels.ClosedChannelException
>>> at 
>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>> at 
>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>> at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>> at 
>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>> at 
>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>> at java.lang.Thread.run(Thread.java:748)
>>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
>>> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
>>> disconnected.
>>> at 
>>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>> at 
>>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>> at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>>> at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>>> at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>>> at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>> at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>> at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>> at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>> at 
>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>>> at hudson.model.Build$BuildExecution.build(Build.java:206)
>>> at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>> at 
>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>> at hudson.model.Run.execute(Run.java:1798)
>>> at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>> at hudson.model.ResourceController.execute(ResourceController.java:97)
>>> at hudson.model.Executor.run(Executor.java:429)
>>> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
>>> java.nio.channels.ClosedChannelException
>>> at 
>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>> at 
>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>> at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>> at 
>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>> at 
>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>> at java.lang.Thread.run(Thread.java:748)
>>> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
>>> call on JNLP4-connect connection from 
>>> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684 failed. The 
>>> channel is closing down or has closed down
>>> at hudson.remoting.Channel.call(Channel.java:948)
>>> at hudson.F

Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-04-25 Thread Carlos Sanchez
what kubernetes cluster are you using and with what networking?
my guess is that the underlying network layer is killing inactive
connections

On Thu, Apr 25, 2019 at 4:24 AM Gopi Naidu  wrote:

> I have got into the same issue. Could you please post the solution if
> anything is found?
>
> On Sunday, 26 August 2018 04:28:47 UTC+5:30, fabio...@singlepoint.ie
> wrote:
>>
>> I'm using Kubernetes plugin 1.12.3
>>
>> The plugin works well, but whenever the agent does streams the log to the
>> master, it causes a connection exception as follows.
>> To reproduce, simply create a free style job, restrict to run on the
>> kubernetes pod, and add a step to sleep for 300 seconds.
>>
>>
>> FATAL: command execution failed
>> java.nio.channels.ClosedChannelException
>>  at 
>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>  at 
>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>  at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>  at 
>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>  at 
>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  at java.lang.Thread.run(Thread.java:748)
>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
>> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
>> disconnected.
>>  at 
>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>  at 
>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>  at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>>  at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>>  at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>>  at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>  at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>>  at hudson.model.Build$BuildExecution.build(Build.java:206)
>>  at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>  at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>  at hudson.model.Run.execute(Run.java:1798)
>>  at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>  at hudson.model.ResourceController.execute(ResourceController.java:97)
>>  at hudson.model.Executor.run(Executor.java:429)
>> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
>> java.nio.channels.ClosedChannelException
>>  at 
>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>  at 
>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>  at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>  at 
>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>  at 
>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  at java.lang.Thread.run(Thread.java:748)
>> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
>> call on JNLP4-connect connection from 
>> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684 failed. The 
>> channel is closing down or has closed down
>>  at hudson.remoting.Channel.call(Channel.java:948)
>>  at hudson.FilePath.act(FilePath.java:1036)
>>  at hudson.FilePath.act(FilePath.java:1025)
>>  at hudson.FilePath.delete(FilePath.java:1511)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
>>  at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>  at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>   

Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-04-24 Thread Gopi Naidu
I have got into the same issue. Could you please post the solution if 
anything is found?

On Sunday, 26 August 2018 04:28:47 UTC+5:30, fabio...@singlepoint.ie wrote:
>
> I'm using Kubernetes plugin 1.12.3
>
> The plugin works well, but whenever the agent does streams the log to the 
> master, it causes a connection exception as follows.
> To reproduce, simply create a free style job, restrict to run on the 
> kubernetes pod, and add a step to sleep for 300 seconds.
>
>
> FATAL: command execution failed
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection from 
> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
> disconnected.
>   at 
> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>   at 
> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>   at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>   at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>   at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>   at hudson.model.Run.execute(Run.java:1798)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>   at hudson.model.Executor.run(Executor.java:429)
> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
> java.nio.channels.ClosedChannelException
>   at 
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>   at 
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>   at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>   at 
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>   at 
> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> Caused: hudson.remoting.ChannelClosedException: Channel "unknown": Remote 
> call on JNLP4-connect connection from 
> ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684 failed. The 
> channel is closing down or has closed down
>   at hudson.remoting.Channel.call(Channel.java:948)
>   at hudson.FilePath.act(FilePath.java:1036)
>   at hudson.FilePath.act(FilePath.java:1025)
>   at hudson.FilePath.delete(FilePath.java:1511)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
>   at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>   at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>   at hudson.model.Build$BuildExecution.build(Build.java:206)
>   at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>   at 
> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>   at hudson.model.Run.execute(Run.java:1798)
>   at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>   at hudson.model.Reso

Re: kubernetes plugin 1.15.1 deletes the pod yaml specified in "Manage Jenkins" Cloud section.

2019-04-22 Thread Philip Mason
Thanks!

On Mon, Apr 22, 2019 at 11:45 AM Carlos Sanchez  wrote:

> this has been fixed in 1.15.2
> https://issues.jenkins-ci.org/browse/JENKINS-57112
>
> On Thu, Apr 18, 2019 at 9:13 PM Philip Mason  wrote:
>
>> Hi,
>>
>> I installed the latest kubernetes plugin 1.15.1 and found that all of my
>> container pod yaml snippets were deleted and anything I put in the text box
>> is no longer persisted.
>>
>> I'm using this means of specifying the pod yaml since legacy non-pipeline
>> jobs can then use the slaves spun up in my Kubernetes cluster.
>>
>> Also, I needed to bump up the ephemeral-storage request in order to
>> successfully run on nodes that have been running for a long time.
>>
>> Is there another place I'm supposed to specify the yaml - other than by
>> using declarative/scripted pipelines?
>>
>> Thanks,
>>
>> - - - Philip
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/171ef771-0b69-48ac-a2a8-985f23062e5b%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/171ef771-0b69-48ac-a2a8-985f23062e5b%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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/V_Kxbe1RQ_U/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Ma2hf2XuKarwKw98xB%2BWS%2BB%2BJ3KDDOj-aK01ozjh3Fjw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Ma2hf2XuKarwKw98xB%2BWS%2BB%2BJ3KDDOj-aK01ozjh3Fjw%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAD9GMuHj2S9H0KYEPjLRw0227xBTjKxrmQrYA9e%2BrUStfvKrfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes plugin with Rancher cluster

2019-04-22 Thread Quang Truong
Hi,

I have setup an on-prem cluster with Rancher 2.X (
https://rancher.com/docs/rke/latest/en/installation/), when I set the 
worker node on the same master, the jnlp slave can start successfully. 
However, when I try a new node in the cluster, I use the master on one 
machine and another machine as worker node then I got this error with the 
slave pod:

SEVERE: http:///tcpSlaveAgentListener/ is invalid: 404 
Not Found
java.io.IOException: http:///tcpSlaveAgentListener/ is 
invalid: 404 Not Found
at 
org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:202)
at hudson.remoting.Engine.innerRun(Engine.java:523)
at hudson.remoting.Engine.run(Engine.java:474)

I try to test the connection on both the master and worker node with:

curl http:///tcpSlaveAgentListener/

then I got response: 


   Jenkins

I'm new with Kubernetes so not sure what happen here. It would be great if 
you can have a suggestion of which on-prem Kubernetes tool should be good 
in case the error because the way Rancher handle the NodePort between 
master and worker node(s).

Thanks,
Quang

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/846ac733-e967-47d7-a3df-532848b7b71f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: kubernetes plugin 1.15.1 deletes the pod yaml specified in "Manage Jenkins" Cloud section.

2019-04-22 Thread Carlos Sanchez
this has been fixed in 1.15.2
https://issues.jenkins-ci.org/browse/JENKINS-57112

On Thu, Apr 18, 2019 at 9:13 PM Philip Mason  wrote:

> Hi,
>
> I installed the latest kubernetes plugin 1.15.1 and found that all of my
> container pod yaml snippets were deleted and anything I put in the text box
> is no longer persisted.
>
> I'm using this means of specifying the pod yaml since legacy non-pipeline
> jobs can then use the slaves spun up in my Kubernetes cluster.
>
> Also, I needed to bump up the ephemeral-storage request in order to
> successfully run on nodes that have been running for a long time.
>
> Is there another place I'm supposed to specify the yaml - other than by
> using declarative/scripted pipelines?
>
> Thanks,
>
> - - - Philip
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/171ef771-0b69-48ac-a2a8-985f23062e5b%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/171ef771-0b69-48ac-a2a8-985f23062e5b%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Ma2hf2XuKarwKw98xB%2BWS%2BB%2BJ3KDDOj-aK01ozjh3Fjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


kubernetes plugin 1.15.1 deletes the pod yaml specified in "Manage Jenkins" Cloud section.

2019-04-18 Thread Philip Mason
Hi,

I installed the latest kubernetes plugin 1.15.1 and found that all of my 
container pod yaml snippets were deleted and anything I put in the text box 
is no longer persisted.

I'm using this means of specifying the pod yaml since legacy non-pipeline 
jobs can then use the slaves spun up in my Kubernetes cluster.

Also, I needed to bump up the ephemeral-storage request in order to 
successfully run on nodes that have been running for a long time.

Is there another place I'm supposed to specify the yaml - other than by 
using declarative/scripted pipelines?

Thanks,

- - - Philip

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/171ef771-0b69-48ac-a2a8-985f23062e5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin in a JobDSL environment

2019-04-05 Thread Sean Walberg
I don't suppose you know which option that is? I see a default parent, but 
no default container. Thanks!

Sean

On Thursday, April 4, 2019 at 3:44:25 PM UTC-4, Carlos Sanchez wrote:
>
> You can't use 'container' with freestyle jobs, there's no way to switch 
> containers .
> IIRC you can set the default container to be different than jnlp
>
> On Thu, Apr 4, 2019, 20:34 Sean Walberg > 
> wrote:
>
>> Hi,
>>
>> The kubernetes-plugin has the "container" keyword to run commands inside 
>> the given container instead of the default jnlp sidecar. Is there an 
>> equivalent in Job DSL?
>>
>> We have everything defined in Job DSL as freestyle jobs and I'm able to 
>> point a job to the Kubernetes label and it'll spin up the containers, but 
>> everything gets run in the jnlp container, not the one I defined in the 
>> global config. The container keyword fixes it if I make a Pipeline job but 
>> unfortunately we don't use that.
>>
>> Thanks,
>>
>> Sean
>>
>> -- 
>> 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 jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/940dcae2-e0d8-4b44-83c5-b0640b3e204d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/940dcae2-e0d8-4b44-83c5-b0640b3e204d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0b376efa-4203-449d-bb43-8e3c51f7611c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin in a JobDSL environment

2019-04-04 Thread Carlos Sanchez
You can't use 'container' with freestyle jobs, there's no way to switch
containers .
IIRC you can set the default container to be different than jnlp

On Thu, Apr 4, 2019, 20:34 Sean Walberg  wrote:

> Hi,
>
> The kubernetes-plugin has the "container" keyword to run commands inside
> the given container instead of the default jnlp sidecar. Is there an
> equivalent in Job DSL?
>
> We have everything defined in Job DSL as freestyle jobs and I'm able to
> point a job to the Kubernetes label and it'll spin up the containers, but
> everything gets run in the jnlp container, not the one I defined in the
> global config. The container keyword fixes it if I make a Pipeline job but
> unfortunately we don't use that.
>
> Thanks,
>
> Sean
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/940dcae2-e0d8-4b44-83c5-b0640b3e204d%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/940dcae2-e0d8-4b44-83c5-b0640b3e204d%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6OPsT3m%3D5JLaCh%3DZc%2BFdNYT%2BJ2r2%2BUzmbP9VPJu6kNKqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes plugin in a JobDSL environment

2019-04-04 Thread Sean Walberg
Hi,

The kubernetes-plugin has the "container" keyword to run commands inside 
the given container instead of the default jnlp sidecar. Is there an 
equivalent in Job DSL?

We have everything defined in Job DSL as freestyle jobs and I'm able to 
point a job to the Kubernetes label and it'll spin up the containers, but 
everything gets run in the jnlp container, not the one I defined in the 
global config. The container keyword fixes it if I make a Pipeline job but 
unfortunately we don't use that.

Thanks,

Sean

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/940dcae2-e0d8-4b44-83c5-b0640b3e204d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Jenkins Kubernetes Plugin] How to restrict/choose kubernetes Cloud access from jenkinsfile

2019-03-05 Thread Carlos Sanchez
Something along the lines of
https://github.com/jenkinsci/kubernetes-plugin/#restricting-what-jobs-can-use-your-configured-cloud
plus maybe some RBAC on the Kubernetes side to prevent service account from
doing things you don't want them to do

On Tue, Mar 5, 2019 at 7:00 PM Nadir Mouhoubi  wrote:

> Hello everyone,
>
> We designed a kubernetes Cluster to launch dynamic Jenkins Agents  and
> everything works fine. This cluster is mutualised for several projets that
> do there build using a cloud defined at Jenkins Administration level.
>
> Recently, we added a projet that uses the same Jenkins cloud and its
> corresponding Kubernetes namespace.
>
> My question is : how can I isolate this project data from other projects?
> for example, how can I protect namespace volumes to be usable by one agent
> and not another?
>
> Thanks for your help.
>
> Nadir.
>
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/ff5fd4c7-269d-4ffb-970f-d1d6c8013d7c%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/ff5fd4c7-269d-4ffb-970f-d1d6c8013d7c%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6OKV2aF6aUjGJNT%3Dup%3D08%2BwXwDi4VVN5njbdVA09-nchA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Jenkins Kubernetes Plugin] How to restrict/choose kubernetes Cloud access from jenkinsfile

2019-03-05 Thread Nadir Mouhoubi
Hello everyone,

We designed a kubernetes Cluster to launch dynamic Jenkins Agents  and 
everything works fine. This cluster is mutualised for several projets that 
do there build using a cloud defined at Jenkins Administration level.

Recently, we added a projet that uses the same Jenkins cloud and its 
corresponding Kubernetes namespace. 

My question is : how can I isolate this project data from other projects? 
for example, how can I protect namespace volumes to be usable by one agent 
and not another? 

Thanks for your help.

Nadir.


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ff5fd4c7-269d-4ffb-970f-d1d6c8013d7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - multi clusters

2019-01-23 Thread Carlos Sanchez
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

On Tue, Jan 22, 2019 at 12:58 PM Tristan FAURE 
wrote:

> 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
>
> Le mar. 22 janv. 2019 à 12:56,  a écrit :
>
>> 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
>>
>> On Friday, January 18, 2019 at 1:53:30 PM UTC+5:30, Tristan FAURE wrote:
>>>
>>> Oops 蘿
>>> Sorry I will test it. Thank you very much
>>>
>>> Le ven. 18 janv. 2019 à 09:21, Carlos Sanchez  a
>>> écrit :
>>>
>>>> In the pipeline you need the "cloud" parameter
>>>>
>>>>
>>>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pod-and-container-template-configuration
>>>>
>>>> On Fri, Jan 18, 2019, 09:02 Tristan FAURE  wrote:
>>>>
>>>>> 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
>>>>> """
>>>>> }
>>>>> }
>>>>>
>>>>>
>>>>> Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>>>>>>
>>>>>> all cloud definitions are used by matching the labels of the pod
>>>>>> templates and your job labels
>>>>>>
>>>>>>
>>>>>> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>>>>>>
>>>>>>
>>>>>> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE 
>>>>>> wrote:
>>>>>>
>>>>>>> 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
>>>>>>>
>>>>>>> --
>>>>>>> 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
>>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com?utm_medium=email_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>> --
>>>>> 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-user

Re: Kubernetes plugin - multi clusters

2019-01-22 Thread Tristan FAURE
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

Le mar. 22 janv. 2019 à 12:56,  a écrit :

> 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
>
> On Friday, January 18, 2019 at 1:53:30 PM UTC+5:30, Tristan FAURE wrote:
>>
>> Oops 蘿
>> Sorry I will test it. Thank you very much
>>
>> Le ven. 18 janv. 2019 à 09:21, Carlos Sanchez  a
>> écrit :
>>
>>> In the pipeline you need the "cloud" parameter
>>>
>>>
>>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pod-and-container-template-configuration
>>>
>>> On Fri, Jan 18, 2019, 09:02 Tristan FAURE  wrote:
>>>
>>>> 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
>>>> """
>>>> }
>>>> }
>>>>
>>>>
>>>> Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>>>>>
>>>>> all cloud definitions are used by matching the labels of the pod
>>>>> templates and your job labels
>>>>>
>>>>>
>>>>> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>>>>>
>>>>>
>>>>> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE 
>>>>> wrote:
>>>>>
>>>>>> 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
>>>>>>
>>>>>> --
>>>>>> 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
>>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com?utm_medium=email_source=footer>
>>>>>> .
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>> 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/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> 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
>&

Re: Kubernetes plugin - multi clusters

2019-01-22 Thread pbasanta2002
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

On Friday, January 18, 2019 at 1:53:30 PM UTC+5:30, Tristan FAURE wrote:
>
> Oops 蘿
> Sorry I will test it. Thank you very much
>
> Le ven. 18 janv. 2019 à 09:21, Carlos Sanchez  > a écrit :
>
>> In the pipeline you need the "cloud" parameter
>>
>>
>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pod-and-container-template-configuration
>>
>> On Fri, Jan 18, 2019, 09:02 Tristan FAURE > > wrote:
>>
>>> 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
>>> """
>>> }
>>> }
>>>
>>>
>>> Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>>>>
>>>> all cloud definitions are used by matching the labels of the pod 
>>>> templates and your job labels
>>>>
>>>>
>>>> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>>>>
>>>>
>>>> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE  
>>>> wrote:
>>>>
>>>>> 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
>>>>>
>>>>> -- 
>>>>> 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
>>>>>  
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com?utm_medium=email_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> -- 
>>> 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/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> -- 
>> 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
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PdB6a5S0qTogucnV2g7axfY%2Bi%2B-Y7Y_gpVz%2BCgh-cv7g%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/97cc7635-2856-4cf3-a6f6-7b971e1a1fdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - multi clusters

2019-01-18 Thread Tristan FAURE
Oops 蘿
Sorry I will test it. Thank you very much

Le ven. 18 janv. 2019 à 09:21, Carlos Sanchez  a écrit :

> In the pipeline you need the "cloud" parameter
>
>
> https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pod-and-container-template-configuration
>
> On Fri, Jan 18, 2019, 09:02 Tristan FAURE  wrote:
>
>> 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
>> """
>> }
>> }
>>
>>
>> Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>>>
>>> all cloud definitions are used by matching the labels of the pod
>>> templates and your job labels
>>>
>>>
>>> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>>>
>>>
>>> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE 
>>> wrote:
>>>
>>>> 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
>>>>
>>>> --
>>>> 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
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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-users+unsubscr...@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
> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PdB6a5S0qTogucnV2g7axfY%2Bi%2B-Y7Y_gpVz%2BCgh-cv7g%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPis%3D3KHjvauYVcbUoTEgVRD3KnR-WXAeMMNNGU5nEy3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - multi clusters

2019-01-18 Thread Carlos Sanchez
In the pipeline you need the "cloud" parameter

https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pod-and-container-template-configuration

On Fri, Jan 18, 2019, 09:02 Tristan FAURE  wrote:

> 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
> """
> }
> }
>
>
> Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>>
>> all cloud definitions are used by matching the labels of the pod
>> templates and your job labels
>>
>>
>> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>>
>>
>> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE 
>> wrote:
>>
>>> 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
>>>
>>> --
>>> 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
>>> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YPdE_ydXeZ6k1%2B4V07jQu8knFqby%2B4jsD0YpUpOjdCb8w%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - multi clusters

2019-01-18 Thread Tristan FAURE
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
"""
}
}


Le jeudi 17 janvier 2019 17:44:43 UTC+1, Carlos Sanchez a écrit :
>
> all cloud definitions are used by matching the labels of the pod templates 
> and your job labels
>
>
> https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents
>
>
> On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE  > wrote:
>
>> 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
>>
>> -- 
>> 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.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4689b90c-7980-4ffc-8fab-9ee0799945f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - multi clusters

2019-01-17 Thread Carlos Sanchez
all cloud definitions are used by matching the labels of the pod templates
and your job labels

https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Nodelabelsforagents


On Thu, Jan 17, 2019 at 5:29 PM Tristan FAURE 
wrote:

> 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
>
> --
> 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+unsubscr...@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.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PSu1hGzAw7tmoAKdS%3DYV_GkAavidHM_6JUCGq-wy5uWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes plugin - multi clusters

2019-01-17 Thread Tristan FAURE
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

-- 
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+unsubscr...@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.


Re: JNLP java.nio.channels.ClosedChannelException with kubernetes-plugin

2019-01-10 Thread roey . azroel
Fabio,

Did you find the solution for this issue or the root cause?

Thanks
Roey

On Sunday, August 26, 2018 at 12:12:27 PM UTC+3, fabio...@singlepoint.ie 
wrote:
>
> Interesting that if I have a loop with some activity as follows, the job 
> completes successfully, so it seems to be a constraint of 60 seconds of 
> inactivity perhaps between the agent and the jnlp?
>
> for i in 1 2 3 4 5
> do
>   echo "Looping ... number $i"
>   sleep 50
> done
>
>
> On Sunday, August 26, 2018 at 9:52:17 AM UTC+1, fabio...@singlepoint.ie 
> wrote:
>>
>> Hi Mark, thanks for the response.
>>
>> Yes, the pod meets the requirements:
>> - I haven't provided a jnlp container
>> - cat is the command
>> - tty is enabled
>> - Additional default container: maven:3.5.4-jdk-8 (tried different ones)
>>
>> What I've observed:
>> - A build step with a sleep of 60 seconds always works
>> - A build step with a sleep of 70 seconds always fails
>>
>> I was wondering, could be  a 60 seconds timeout in either the JNLP or 
>> somewhere else?
>>  
>>
>> On Sunday, August 26, 2018 at 12:02:14 AM UTC+1, Mark Waite wrote:
>>>
>>> Does the pod template meet the Kubernetes plugin constraints 
>>> <https://github.com/jenkinsci/kubernetes-plugin#constraints> mentioned 
>>> in readme? Specifically, is ttyEnabled and is there a long-running process 
>>> that will allow the pod to continue running until the job completes?
>>>
>>> On Sat, Aug 25, 2018 at 4:58 PM  wrote:
>>>
>>>> I'm using Kubernetes plugin 1.12.3
>>>>
>>>> The plugin works well, but whenever the agent does streams the log to 
>>>> the master, it causes a connection exception as follows.
>>>> To reproduce, simply create a free style job, restrict to run on the 
>>>> kubernetes pod, and add a step to sleep for 300 seconds.
>>>>
>>>>
>>>> FATAL: command execution failed
>>>> java.nio.channels.ClosedChannelException
>>>>at 
>>>> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>>>>at 
>>>> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:142)
>>>>at org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:795)
>>>>at 
>>>> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>>>>at 
>>>> jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
>>>>at 
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>>>at 
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>>>at java.lang.Thread.run(Thread.java:748)
>>>> Caused: java.io.IOException: Backing channel 'JNLP4-connect connection 
>>>> from ip-192-168-247-3.us-west-2.compute.internal/192.168.247.3:23684' is 
>>>> disconnected.
>>>>at 
>>>> hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationHandler.java:214)
>>>>at 
>>>> hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:283)
>>>>at com.sun.proxy.$Proxy110.isAlive(Unknown Source)
>>>>at hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1137)
>>>>at hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1129)
>>>>at hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
>>>>at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
>>>>at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
>>>>at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
>>>>at 
>>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
>>>>at hudson.model.Build$BuildExecution.build(Build.java:206)
>>>>at hudson.model.Build$BuildExecution.doRun(Build.java:163)
>>>>at 
>>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
>>>>at hudson.model.Run.execute(Run.java:1798)
>>>>at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>>>>at hudson.model.ResourceController.execute(ResourceController.java:97)
>>>>at hudson.model.Executor.run(Executor.java:429)
>>>> FATAL: Unable to delete script file /tmp/jenkins5788393309854271460.sh
>>

Re: Kubernetes plugin configuration using groovy

2019-01-03 Thread Alex
Hi there,

It works for me with the CASC plugin like this:

jenkins:
  clouds:
- kubernetes:
name: "Kubernetes"
skipTlsVerify: true
namespace: "jenkins"
jenkinsUrl: "http://localhost:8080;
connectTimeout: 0
readTimeout: 0
containerCapStr: 100
maxRequestsPerHostStr: 64
retentionTimeout: 5
templates:
  - name: "jenkins-slave"
namespace: "jenkins"
nodeUsageMode: NORMAL
containers:
  - name: "jnlp"
image: "jenkinsci/jnlp-slave"
alwaysPullImage: false
workingDir: "/home/jenkins"
ttyEnabled: true
resourceRequestCpu: "500m"
resourceLimitCpu: "1000m"
resourceRequestMemory: "1Gi"
resourceLimitMemory: "2Gi"
idleMinutes: "30"
activeDeadlineSeconds: "900"
slaveConnectTimeout: "120"
serviceAccount: "jenkins"


These are the plugins that i use:

configuration-as-code
configuration-as-code-support
kubernetes:1.13.3
kubernetes-cd
crowd2
workflow-aggregator
git
pipeline-utility-steps

Alex

On Thursday, 3 January 2019 15:07:26 UTC, unguiculus wrote:
>
> Did you manage to solve the issue? I'm actually having the same problem 
> but I do use the CasC plugin as Carlos suggested. Everything looks ok in 
> the UI but only starts working if I hit "Save".
>
> I copied away the whole JENKINS_HOME before and after hitting "Save". As 
> expected, the diff doesn't show any changes. I tried triggering a reload of 
> the config via CLI and via Groovy init script. Nothing helped but manually 
> saving in the UI.
>
> Here's the relevant part from the jenkins.yaml:
>
> jenkins:
>   clouds:
> - kubernetes:
> name: kubernetes
> serverUrl: https://kubernetes.default
> namespace: default
> jenkinsUrl: http://jenkins-master:8080
> jenkinsTunnel: jenkins-agent:5
> templates:
>   - name: k8s-agent
> idleMinutes: 30
> containers:
>   - name: jnlp
> image: jenkinsci/jnlp-slave:3.27-1-alpine
> command: ""
> args: ""
>
>
> Jenkins version: 2.150.1 LTS
>
> Installed plugins:
>
> configuration-as-code:1.4
> workflow-aggregator:2.6
> kubernetes:1.14.2
> kubernetes-credentials-provider:0.10
> timestamper:1.8.10
> locale:1.4
>
> I'd appreciate any help.
>
> --Reinhard
>
>
> On Monday, August 20, 2018 at 4:39:57 PM UTC+2, Carlos Sanchez wrote:
>>
>> Have you tried configuration as code plugin?
>>
>> On Mon, Aug 20, 2018, 15:54 Alex  wrote:
>>
>>> I am trying to configure the kubernetes plugin by using groovy at 
>>> startup. 
>>>
>>> The problem that I have is that I can see the configuration in the 
>>> "Configure System" menu, but it's not working unless i click on "Save"
>>>
>>> This is my groovy:
>>>
>>> import org.csanchez.jenkins.plugins.kubernetes.*
>>> import jenkins.model.*
>>>
>>> def jenkins_instance = Jenkins.instance
>>> def kubernetes = new KubernetesCloud('Kubernetes')
>>>
>>> // Configure Kubernetes Cloud
>>> kubernetes.setNamespace('jenkins')
>>> kubernetes.setJenkinsUrl(jenkins_instance.getRootUrl())
>>> kubernetes.setMaxRequestsPerHostStr('30')
>>> kubernetes.setConnectTimeout(30)
>>> kubernetes.setReadTimeout(30)
>>> kubernetes.setUsageRestricted(false)
>>>
>>> // Configure Jenkins Slave Container
>>> jenkins_slave_image = System.getenv('JENKINS_SLAVE_IMAGE').toString()
>>> def jenkins_container = new ContainerTemplate('jenkins-slave', 
>>> jenkins_slave_image)
>>> jenkins_container.setTtyEnabled(true)
>>> jenkins_container.setName('jeknins-slave')
>>>
>>> // Configure Jenkins Slave Pods
>>> def jenkins_slave_pod = new PodTemplate()
>>> jenkins_slave_pod.setNamespace('jenkins')
>>> jenkins_slave_pod.setName('jenkins-slave')
>>> jenkins_slave_pod.setContainers([jenkins_container])
>>> jenkins_slave_pod.save()
>>>
>>> // Save Changes
>>> kubernetes.addTemplate(jenkins_slave_pod)
>>> jenkins_instance.clouds.removeAll(KubernetesCloud)
>>> jenkins_instance.clouds.addAll(kubernetes)
>>> jenkins_instance.save()
>>>
>>> An

Re: Kubernetes plugin configuration using groovy

2019-01-03 Thread unguiculus
Did you manage to solve the issue? I'm actually having the same problem but 
I do use the CasC plugin as Carlos suggested. Everything looks ok in the UI 
but only starts working if I hit "Save".

I copied away the whole JENKINS_HOME before and after hitting "Save". As 
expected, the diff doesn't show any changes. I tried triggering a reload of 
the config via CLI and via Groovy init script. Nothing helped but manually 
saving in the UI.

Here's the relevant part from the jenkins.yaml:

jenkins:
  clouds:
- kubernetes:
name: kubernetes
serverUrl: https://kubernetes.default
namespace: default
jenkinsUrl: http://jenkins-master:8080
jenkinsTunnel: jenkins-agent:5
templates:
  - name: k8s-agent
idleMinutes: 30
containers:
  - name: jnlp
image: jenkinsci/jnlp-slave:3.27-1-alpine
command: ""
args: ""


Jenkins version: 2.150.1 LTS

Installed plugins:

configuration-as-code:1.4
workflow-aggregator:2.6
kubernetes:1.14.2
kubernetes-credentials-provider:0.10
timestamper:1.8.10
locale:1.4

I'd appreciate any help.

--Reinhard


On Monday, August 20, 2018 at 4:39:57 PM UTC+2, Carlos Sanchez wrote:
>
> Have you tried configuration as code plugin?
>
> On Mon, Aug 20, 2018, 15:54 Alex > 
> wrote:
>
>> I am trying to configure the kubernetes plugin by using groovy at 
>> startup. 
>>
>> The problem that I have is that I can see the configuration in the 
>> "Configure System" menu, but it's not working unless i click on "Save"
>>
>> This is my groovy:
>>
>> import org.csanchez.jenkins.plugins.kubernetes.*
>> import jenkins.model.*
>>
>> def jenkins_instance = Jenkins.instance
>> def kubernetes = new KubernetesCloud('Kubernetes')
>>
>> // Configure Kubernetes Cloud
>> kubernetes.setNamespace('jenkins')
>> kubernetes.setJenkinsUrl(jenkins_instance.getRootUrl())
>> kubernetes.setMaxRequestsPerHostStr('30')
>> kubernetes.setConnectTimeout(30)
>> kubernetes.setReadTimeout(30)
>> kubernetes.setUsageRestricted(false)
>>
>> // Configure Jenkins Slave Container
>> jenkins_slave_image = System.getenv('JENKINS_SLAVE_IMAGE').toString()
>> def jenkins_container = new ContainerTemplate('jenkins-slave', 
>> jenkins_slave_image)
>> jenkins_container.setTtyEnabled(true)
>> jenkins_container.setName('jeknins-slave')
>>
>> // Configure Jenkins Slave Pods
>> def jenkins_slave_pod = new PodTemplate()
>> jenkins_slave_pod.setNamespace('jenkins')
>> jenkins_slave_pod.setName('jenkins-slave')
>> jenkins_slave_pod.setContainers([jenkins_container])
>> jenkins_slave_pod.save()
>>
>> // Save Changes
>> kubernetes.addTemplate(jenkins_slave_pod)
>> jenkins_instance.clouds.removeAll(KubernetesCloud)
>> jenkins_instance.clouds.addAll(kubernetes)
>> jenkins_instance.save()
>>
>> Any thoughts on this?
>>
>>
>> -- 
>> 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/85bd4d52-5083-4536-ae26-61370ac984a4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/85bd4d52-5083-4536-ae26-61370ac984a4%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/3cbc1fcf-cb2c-4045-a7e0-2b7530f8c667%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [kubernetes plugin] yamlFile libraryResource

2018-12-21 Thread Arnaud bourree
I created issue https://issues.jenkins-ci.org/browse/JENKINS-55299

Le ven. 21 déc. 2018 à 14:18, Arnaud bourree  a
écrit :

> Hello,
>
> I'd like to move pod definition from pipeline to a file resource in a
> shared library.
>
> My pipeline is like:
> pipeline {
> agent none
> stages {
> stage('step-in-kubernetes') {
> agent {
> kubernetes {
> label 'kube'
> yamlFile libraryResource('myPod.yaml')
> }
> }
> stages {
> stage('Checkout') {
> steps {
> checkout([$class: 'MercurialSCM', clean: true,
> source: 'https://acme.com/hg/myproject'])
> }
> }
> }
> }
> }
> }
>
> I put 'myPod.yaml' in resources folder of my library.
> I get an error saying that HG is not installed.
>
> But:
> - it's work if I used yaml property instead of yamlFile
> - libraryResource fails when using wrong filename
>
> Did anyone try same use-case?
>
> Regards,
>
> Arnaud.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAESUf_DNj9k7QjoTmKGRcg6ya2JGG1CbLaFzEvZ3Rq13wdoVhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[kubernetes plugin] yamlFile libraryResource

2018-12-21 Thread Arnaud bourree
Hello,

I'd like to move pod definition from pipeline to a file resource in a
shared library.

My pipeline is like:
pipeline {
agent none
stages {
stage('step-in-kubernetes') {
agent {
kubernetes {
label 'kube'
yamlFile libraryResource('myPod.yaml')
}
}
stages {
stage('Checkout') {
steps {
checkout([$class: 'MercurialSCM', clean: true,
source: 'https://acme.com/hg/myproject'])
}
}
}
}
}
}

I put 'myPod.yaml' in resources folder of my library.
I get an error saying that HG is not installed.

But:
- it's work if I used yaml property instead of yamlFile
- libraryResource fails when using wrong filename

Did anyone try same use-case?

Regards,

Arnaud.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAESUf_DkcgiLK0c_iSXu8b5n83V6Tq%3DeeR99Xk5vswLbXY0MYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-14 Thread Simon Young
Unfortunately it's not fixed in 1.13.8. We now see this:

Connection was rejected, you should increase the Max connections to 
Kubernetes API

I tried increasing Max connections to 400. The next build passed, but 
subsequent builds are failing, just like we saw with 1.13.7.

I have to roll back to 1.13.5.



On Friday, December 14, 2018 at 11:39:59 AM UTC, Carlos Sanchez wrote:
>
> This should be fixed in 1.13.8
>
> On Fri, Dec 14, 2018, 08:31 Simon Young  > wrote:
>
>> Hi Carlos,
>>
>> Rolling back to 1.13.5 seems to have fixed the issue. I can now run 
>> multiple consecutive builds and they all pass.
>>
>> I'm a bit concerned that we're unable to upgrade to the latest version 
>> though - Do you have enough information to identify the problem?
>>
>> Thanks,
>>
>> Simon.
>>
>> -- 
>> 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/139429ab-498d-44c4-9c96-955075cbbfb3%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2f6f320c-19ea-4595-8ce1-66ef615938d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-14 Thread Carlos Sanchez
This should be fixed in 1.13.8

On Fri, Dec 14, 2018, 08:31 Simon Young 
wrote:

> Hi Carlos,
>
> Rolling back to 1.13.5 seems to have fixed the issue. I can now run
> multiple consecutive builds and they all pass.
>
> I'm a bit concerned that we're unable to upgrade to the latest version
> though - Do you have enough information to identify the problem?
>
> Thanks,
>
> Simon.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/139429ab-498d-44c4-9c96-955075cbbfb3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PO8ZPxce-oJTzBj7_xxY2hfbi_tkmFVdHf6%3D%3DWw%3DuUOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - How to configure service account when master is not deployed in K8S?

2018-12-14 Thread Carlos Sanchez
That sounds right. Do you have the right permissions in that service
account? List pods at least

On Tue, Dec 11, 2018, 07:58  wrote:

> Hi Carlos,
>
> Thank you for your response. Could you elaborate a bit more, like giving
> me an example?
>
> Like I said before, I couldn't get it to work. I just pasted the token
> after base64 decoding it. I receive a 401 while doing a curl with the same
> token value works properly.
>
> Thank you very much for your fast response.
>
> Regards
>
> terça-feira, 11 de Dezembro de 2018 às 15:55:11 UTC, Carlos Sanchez
> escreveu:
>>
>> secret text it is
>>
>> On Tue, Dec 11, 2018 at 7:49 AM  wrote:
>>
>>> Hello all,
>>>
>>> I'm having issues with the Kubernetes Plugin:
>>> https://github.com/jenkinsci/kubernetes-plugin
>>>
>>> I configured it successfully with Minikube, but once I moved to a real
>>> cluster, I couldn't make it work. The plugin documentation assumes we are
>>> deploying the Jenkins master in the same K8S cluster, which is not my case.
>>> Jenkins is on another environment, not even in K8S.
>>>
>>> I created a service account for the namespace I am trying to use. I can
>>> do a CURL and use the header "Authorization: Bearer TOKEN". It works
>>> correctly, so the K8S namespace is ok. But I can't get it to work with
>>> Jenkins.
>>>
>>> Which type of credential should I use? I tried basically every
>>> credential, including secret text, but I cannot get a successful
>>> connection. I always receive a:
>>>
>>> Error testing connection https://: Failure
>>> executing: GET at:  
>>> https:///api/v1/namespaces/team-release-management-automation-hackathon/pods.
>>> Message: Unauthorized. Received status: Status(apiVersion=v1, code=401,
>>> details=null, kind=Status, message=Unauthorized,
>>> metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null,
>>> additionalProperties={}), reason=Unauthorized, status=Failure,
>>> additionalProperties={}).
>>>
>>> How can I use a service account and authenticate using a token?
>>>
>>> Thank you very much.
>>>
>>> --
>>> 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/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/57f90dec-e266-46f3-aa13-dacefc59c7ed%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/57f90dec-e266-46f3-aa13-dacefc59c7ed%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6Mf9%2B1cvMy4gedN5mwUfO2QY8LUJxtvZ%3D7bqQOtgPWKHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-14 Thread Simon Young
Hi Carlos,

Rolling back to 1.13.5 seems to have fixed the issue. I can now run 
multiple consecutive builds and they all pass.

I'm a bit concerned that we're unable to upgrade to the latest version 
though - Do you have enough information to identify the problem?

Thanks,

Simon.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/139429ab-498d-44c4-9c96-955075cbbfb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - How to configure service account when master is not deployed in K8S?

2018-12-11 Thread andretmcarmo
Hi Carlos,

Thank you for your response. Could you elaborate a bit more, like giving me 
an example?

Like I said before, I couldn't get it to work. I just pasted the token 
after base64 decoding it. I receive a 401 while doing a curl with the same 
token value works properly.

Thank you very much for your fast response.

Regards

terça-feira, 11 de Dezembro de 2018 às 15:55:11 UTC, Carlos Sanchez 
escreveu:
>
> secret text it is
>
> On Tue, Dec 11, 2018 at 7:49 AM > wrote:
>
>> Hello all,
>>
>> I'm having issues with the Kubernetes Plugin: 
>> https://github.com/jenkinsci/kubernetes-plugin
>>
>> I configured it successfully with Minikube, but once I moved to a real 
>> cluster, I couldn't make it work. The plugin documentation assumes we are 
>> deploying the Jenkins master in the same K8S cluster, which is not my case. 
>> Jenkins is on another environment, not even in K8S.
>>
>> I created a service account for the namespace I am trying to use. I can 
>> do a CURL and use the header "Authorization: Bearer TOKEN". It works 
>> correctly, so the K8S namespace is ok. But I can't get it to work with 
>> Jenkins.
>>
>> Which type of credential should I use? I tried basically every 
>> credential, including secret text, but I cannot get a successful 
>> connection. I always receive a:
>>
>> Error testing connection https://: Failure 
>> executing: GET at:  
>> https:///api/v1/namespaces/team-release-management-automation-hackathon/pods.
>>  
>> Message: Unauthorized. Received status: Status(apiVersion=v1, code=401, 
>> details=null, kind=Status, message=Unauthorized, 
>> metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, 
>> additionalProperties={}), reason=Unauthorized, status=Failure, 
>> additionalProperties={}).
>>
>> How can I use a service account and authenticate using a token?
>>
>> Thank you very much.
>>
>> -- 
>> 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/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/57f90dec-e266-46f3-aa13-dacefc59c7ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - How to configure service account when master is not deployed in K8S?

2018-12-11 Thread Carlos Sanchez
secret text it is

On Tue, Dec 11, 2018 at 7:49 AM  wrote:

> Hello all,
>
> I'm having issues with the Kubernetes Plugin:
> https://github.com/jenkinsci/kubernetes-plugin
>
> I configured it successfully with Minikube, but once I moved to a real
> cluster, I couldn't make it work. The plugin documentation assumes we are
> deploying the Jenkins master in the same K8S cluster, which is not my case.
> Jenkins is on another environment, not even in K8S.
>
> I created a service account for the namespace I am trying to use. I can do
> a CURL and use the header "Authorization: Bearer TOKEN". It works
> correctly, so the K8S namespace is ok. But I can't get it to work with
> Jenkins.
>
> Which type of credential should I use? I tried basically every credential,
> including secret text, but I cannot get a successful connection. I always
> receive a:
>
> Error testing connection https://: Failure
> executing: GET at:  
> https:///api/v1/namespaces/team-release-management-automation-hackathon/pods.
> Message: Unauthorized. Received status: Status(apiVersion=v1, code=401,
> details=null, kind=Status, message=Unauthorized,
> metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null,
> additionalProperties={}), reason=Unauthorized, status=Failure,
> additionalProperties={}).
>
> How can I use a service account and authenticate using a token?
>
> Thank you very much.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6MzO49fJVsmUx37kq5eCoUeV1powoaOdhjEiRmqpL0zAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes Plugin - How to configure service account when master is not deployed in K8S?

2018-12-11 Thread andretmcarmo
Hello all,

I'm having issues with the Kubernetes 
Plugin: https://github.com/jenkinsci/kubernetes-plugin

I configured it successfully with Minikube, but once I moved to a real 
cluster, I couldn't make it work. The plugin documentation assumes we are 
deploying the Jenkins master in the same K8S cluster, which is not my case. 
Jenkins is on another environment, not even in K8S.

I created a service account for the namespace I am trying to use. I can do 
a CURL and use the header "Authorization: Bearer TOKEN". It works 
correctly, so the K8S namespace is ok. But I can't get it to work with 
Jenkins.

Which type of credential should I use? I tried basically every credential, 
including secret text, but I cannot get a successful connection. I always 
receive a:

Error testing connection https://: Failure 
executing: GET at:  
https:///api/v1/namespaces/team-release-management-automation-hackathon/pods.
 
Message: Unauthorized. Received status: Status(apiVersion=v1, code=401, 
details=null, kind=Status, message=Unauthorized, 
metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, 
additionalProperties={}), reason=Unauthorized, status=Failure, 
additionalProperties={}).

How can I use a service account and authenticate using a token?

Thank you very much.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/790b111c-5f60-4317-8628-18ef1b6fcf19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-11 Thread Carlos Sanchez
I would rollback to 1.13.5 for now then

On Tue, Dec 11, 2018, 00:49 Simon Young 
wrote:

> Hi Carlos,
>
> Thanks for the suggestion. I have tried changing the "Max connections to
> Kubernetes API" and this does have an effect, but not in a way I'd
> expect... I've found that if I change that value in any way at all (either
> increase or decrease), then the next build always passes, and all
> subsequent builds fail.
>
> So for example, I tried raising the value to 200 via the Jenkins UI. I hit
> 'Apply' and re-ran the job and it passed, but it failed the next time it
> ran, so I raised the value to 400. Again, the next job passed, but any
> after that failed. At this point, I suspected that changing the value in
> any way might have this effect, so I reduced the value back to 32. Same
> thing happened - pass, then subsequent fails. I reduced the value all the
> way down to 1, and observed the same symptoms.
>
> I tried changing other plugin configuration values such as "Connection
> Timeout" and "Container Cap", but this did not have the same effect.
>
> It's also worth noting if I don't run the job for about an hour, the next
> build passes and subsequent builds fail. Same happens if I restart Jenkins
> (but not if I just reload the config from disk).
>
> So it seems like some internal counter on the Jenkins master is reaching a
> limit, and the counter is reset when the config changes or after a period
> of activity. Neither master nor slave appear to be running out of physical
> resources, and this is the only job we're running on the master.
>
> Have you any idea what could be going on here?
>
> Simon.
>
>
>
> On Monday, December 10, 2018 at 4:10:27 PM UTC, Carlos Sanchez wrote:
>>
>> You may be hitting the limit of concurrent connections to k8s api, see
>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/CHANGELOG.md#1136
>>
>> On Mon, Dec 10, 2018 at 8:01 AM Simon Young <
>> simon...@nationaltrust.org.uk> wrote:
>>
> Hi,
>>>
>>> We are trying to use the Kubernetes Plugin to run tests in a different
>>> container - but *almost* every time we try and execute a command in the
>>> second container, the build fails immediately. I say "almost" because the
>>> build always succeeds after restarting the Jenkins master (or possibly
>>> after it's been idle for a long time).
>>>
>>> Here's the Jenkinsfile we're using to test:
>>>
>>> def label = "k8s-test-${UUID.randomUUID().toString()}"
>>>
>>> podTemplate(
>>> cloud: 'kubernetes-test.k8s.local',
>>> namespace: 'mynamespace',
>>> label: label,
>>> yaml: """
>>> apiVersion: v1
>>> kind: Pod
>>> spec:
>>>   containers:
>>>   - name: busybox
>>> image: busybox
>>> command: ['cat']
>>> tty: true
>>> """
>>> ) {
>>>
>>> node (label) {
>>> stage ('Get Agent Info') {
>>> sh "java -version"
>>> }
>>> stage ('Run tests') {
>>> container('busybox') {
>>> sh "echo foo"
>>> sh "netstat -tln"
>>> sh "df -h"
>>> }
>>> }
>>> stage ('Grab Logs') {
>>> containerLog('jnlp')
>>> }
>>> }
>>> }
>>>
>>> This fails at the "echo foo" step. The error reported by the pipeline is:
>>>
>>> Task okhttp3.RealCall$AsyncCall@b5277fa rejected from
>>> java.util.concurrent.ThreadPoolExecutor@6c383ec7[Terminated, pool size
>>> = 0, active threads = 0, queued tasks = 0, completed tasks = 3]
>>>
>>> What we know so far:
>>>
>>> * Both containers are successfully deployed to the same pod, as expected.
>>> * If we don't try and run the shell commands on the 'busybox' container,
>>> the build completes successfully.
>>> * If Jenkins is restarted, the build passes. But subsequent builds fail.
>>> * The Agent logs contain similar exceptions whether the builds pass or
>>> fail, so it's hard to pinpoint a cause.
>>>
>>> The ThreadPool exception may imply that *something* has run out of
>>> Executors, but it's not clear what, or how to rectify the situation.
>>>
>>> Has anyone seen anything like this? Any ideas how to get to the bottom
>>> of it? As per the

Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-11 Thread Simon Young
Hi Carlos,

Thanks for the suggestion. I have tried changing the "Max connections to 
Kubernetes API" and this does have an effect, but not in a way I'd 
expect... I've found that if I change that value in any way at all (either 
increase or decrease), then the next build always passes, and all 
subsequent builds fail.

So for example, I tried raising the value to 200 via the Jenkins UI. I hit 
'Apply' and re-ran the job and it passed, but it failed the next time it 
ran, so I raised the value to 400. Again, the next job passed, but any 
after that failed. At this point, I suspected that changing the value in 
any way might have this effect, so I reduced the value back to 32. Same 
thing happened - pass, then subsequent fails. I reduced the value all the 
way down to 1, and observed the same symptoms.

I tried changing other plugin configuration values such as "Connection 
Timeout" and "Container Cap", but this did not have the same effect.

It's also worth noting if I don't run the job for about an hour, the next 
build passes and subsequent builds fail. Same happens if I restart Jenkins 
(but not if I just reload the config from disk).

So it seems like some internal counter on the Jenkins master is reaching a 
limit, and the counter is reset when the config changes or after a period 
of activity. Neither master nor slave appear to be running out of physical 
resources, and this is the only job we're running on the master.

Have you any idea what could be going on here?

Simon.



On Monday, December 10, 2018 at 4:10:27 PM UTC, Carlos Sanchez wrote:
>
> You may be hitting the limit of concurrent connections to k8s api, see 
> https://github.com/jenkinsci/kubernetes-plugin/blob/master/CHANGELOG.md#1136
>
> On Mon, Dec 10, 2018 at 8:01 AM Simon Young  > wrote:
>
>> Hi,
>>
>> We are trying to use the Kubernetes Plugin to run tests in a different 
>> container - but *almost* every time we try and execute a command in the 
>> second container, the build fails immediately. I say "almost" because the 
>> build always succeeds after restarting the Jenkins master (or possibly 
>> after it's been idle for a long time).
>>
>> Here's the Jenkinsfile we're using to test:
>>
>> def label = "k8s-test-${UUID.randomUUID().toString()}"
>>
>> podTemplate(
>> cloud: 'kubernetes-test.k8s.local',
>> namespace: 'mynamespace',
>> label: label,
>> yaml: """
>> apiVersion: v1
>> kind: Pod
>> spec:
>>   containers:
>>   - name: busybox
>> image: busybox
>> command: ['cat']
>> tty: true
>> """
>> ) {
>>
>> node (label) {
>> stage ('Get Agent Info') {
>> sh "java -version"
>> }
>> stage ('Run tests') {
>> container('busybox') {
>> sh "echo foo"
>> sh "netstat -tln"
>> sh "df -h"
>> }
>> }
>> stage ('Grab Logs') {
>> containerLog('jnlp')
>> }
>> }
>> }
>>
>> This fails at the "echo foo" step. The error reported by the pipeline is:
>>
>> Task okhttp3.RealCall$AsyncCall@b5277fa rejected from 
>> java.util.concurrent.ThreadPoolExecutor@6c383ec7[Terminated, pool size = 0, 
>> active threads = 0, queued tasks = 0, completed tasks = 3]
>>
>> What we know so far:
>>
>> * Both containers are successfully deployed to the same pod, as expected.
>> * If we don't try and run the shell commands on the 'busybox' container, 
>> the build completes successfully.
>> * If Jenkins is restarted, the build passes. But subsequent builds fail.
>> * The Agent logs contain similar exceptions whether the builds pass or 
>> fail, so it's hard to pinpoint a cause.
>>
>> The ThreadPool exception may imply that *something* has run out of 
>> Executors, but it's not clear what, or how to rectify the situation.
>>
>> Has anyone seen anything like this? Any ideas how to get to the bottom of 
>> it? As per the plugin's README, I've created Jenkins log recorders for 
>> org.csanchez.jenkins.plugins.kubernetes and okhttp3, but there are no 
>> obvious problems reported in the logs.
>>
>> Software Versions:
>>
>> Jenkins: v2.150.1
>> Kubernetes Plugin: 1.13.7
>> Kubernetes: 1.10.11 (same behaviour observed on 1.8.7)
>>
>> All suggestions appreciated!
>>
>> Thanks,
>>
>> Simon.
>>
>> -- 
>> You received this message because you are subscribed to the

Re: Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-10 Thread Carlos Sanchez
You may be hitting the limit of concurrent connections to k8s api, see
https://github.com/jenkinsci/kubernetes-plugin/blob/master/CHANGELOG.md#1136

On Mon, Dec 10, 2018 at 8:01 AM Simon Young <
simon.yo...@nationaltrust.org.uk> wrote:

> Hi,
>
> We are trying to use the Kubernetes Plugin to run tests in a different
> container - but *almost* every time we try and execute a command in the
> second container, the build fails immediately. I say "almost" because the
> build always succeeds after restarting the Jenkins master (or possibly
> after it's been idle for a long time).
>
> Here's the Jenkinsfile we're using to test:
>
> def label = "k8s-test-${UUID.randomUUID().toString()}"
>
> podTemplate(
> cloud: 'kubernetes-test.k8s.local',
> namespace: 'mynamespace',
> label: label,
> yaml: """
> apiVersion: v1
> kind: Pod
> spec:
>   containers:
>   - name: busybox
> image: busybox
> command: ['cat']
> tty: true
> """
> ) {
>
> node (label) {
> stage ('Get Agent Info') {
> sh "java -version"
> }
> stage ('Run tests') {
> container('busybox') {
> sh "echo foo"
> sh "netstat -tln"
> sh "df -h"
> }
> }
> stage ('Grab Logs') {
> containerLog('jnlp')
> }
> }
> }
>
> This fails at the "echo foo" step. The error reported by the pipeline is:
>
> Task okhttp3.RealCall$AsyncCall@b5277fa rejected from
> java.util.concurrent.ThreadPoolExecutor@6c383ec7[Terminated, pool size =
> 0, active threads = 0, queued tasks = 0, completed tasks = 3]
>
> What we know so far:
>
> * Both containers are successfully deployed to the same pod, as expected.
> * If we don't try and run the shell commands on the 'busybox' container,
> the build completes successfully.
> * If Jenkins is restarted, the build passes. But subsequent builds fail.
> * The Agent logs contain similar exceptions whether the builds pass or
> fail, so it's hard to pinpoint a cause.
>
> The ThreadPool exception may imply that *something* has run out of
> Executors, but it's not clear what, or how to rectify the situation.
>
> Has anyone seen anything like this? Any ideas how to get to the bottom of
> it? As per the plugin's README, I've created Jenkins log recorders for
> org.csanchez.jenkins.plugins.kubernetes and okhttp3, but there are no
> obvious problems reported in the logs.
>
> Software Versions:
>
> Jenkins: v2.150.1
> Kubernetes Plugin: 1.13.7
> Kubernetes: 1.10.11 (same behaviour observed on 1.8.7)
>
> All suggestions appreciated!
>
> Thanks,
>
> Simon.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/141b526e-f00b-434d-9f43-ec97fdb23df7%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/141b526e-f00b-434d-9f43-ec97fdb23df7%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PM4RaDkYy-MZ8CJceoJxap-cxr3bMQZtR7oVzuJd2Tjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes Plugin - Fails When Executing Commands on Second Container

2018-12-10 Thread Simon Young
Hi,

We are trying to use the Kubernetes Plugin to run tests in a different 
container - but *almost* every time we try and execute a command in the 
second container, the build fails immediately. I say "almost" because the 
build always succeeds after restarting the Jenkins master (or possibly 
after it's been idle for a long time).

Here's the Jenkinsfile we're using to test:

def label = "k8s-test-${UUID.randomUUID().toString()}"

podTemplate(
cloud: 'kubernetes-test.k8s.local',
namespace: 'mynamespace',
label: label,
yaml: """
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: busybox
image: busybox
command: ['cat']
tty: true
"""
) {

node (label) {
stage ('Get Agent Info') {
sh "java -version"
}
stage ('Run tests') {
container('busybox') {
sh "echo foo"
sh "netstat -tln"
sh "df -h"
}
}
stage ('Grab Logs') {
containerLog('jnlp')
}
}
}

This fails at the "echo foo" step. The error reported by the pipeline is:

Task okhttp3.RealCall$AsyncCall@b5277fa rejected from 
java.util.concurrent.ThreadPoolExecutor@6c383ec7[Terminated, pool size = 0, 
active threads = 0, queued tasks = 0, completed tasks = 3]

What we know so far:

* Both containers are successfully deployed to the same pod, as expected.
* If we don't try and run the shell commands on the 'busybox' container, 
the build completes successfully.
* If Jenkins is restarted, the build passes. But subsequent builds fail.
* The Agent logs contain similar exceptions whether the builds pass or 
fail, so it's hard to pinpoint a cause.

The ThreadPool exception may imply that *something* has run out of 
Executors, but it's not clear what, or how to rectify the situation.

Has anyone seen anything like this? Any ideas how to get to the bottom of 
it? As per the plugin's README, I've created Jenkins log recorders for 
org.csanchez.jenkins.plugins.kubernetes and okhttp3, but there are no 
obvious problems reported in the logs.

Software Versions:

Jenkins: v2.150.1
Kubernetes Plugin: 1.13.7
Kubernetes: 1.10.11 (same behaviour observed on 1.8.7)

All suggestions appreciated!

Thanks,

Simon.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/141b526e-f00b-434d-9f43-ec97fdb23df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin - ready probe

2018-11-19 Thread Carlos Sanchez
the latest agent logs may be in the jenkins logs if the agent fails to start

On Mon, Nov 19, 2018 at 7:44 PM Romain Grécourt 
wrote:

> Unfortunately I don't have cluster access (eclipse policy) and this issue
> is somewhat intermittent.
> Will get back to you if/when I get these logs.
>
> On Sun, Nov 18, 2018 at 11:56 PM Carlos Sanchez  wrote:
>
>> you need to check your pod logs and k8s describe them to see what's the
>> possible error
>>
>> On Sat, Nov 17, 2018 at 1:47 PM Romain Grécourt <
>> romain.greco...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I'm doing a Jenkins pipeline with the kubernetes plugin (1.12.4).
>>>
>>> Currently facing some odd behaviors where steps are executed before the
>>> pod is actually "ready". See some of the errors  I got below.
>>>
>>> One of the recurring error is about a non existing directory inside the
>>> workspace, or the main container not existing in the pod.
>>>
>>> BTW, what's exit code -2 ?
>>>
>>> Looking at the pod definition I don't see any probe for the injected
>>> jnlp container.
>>> Should I define a probe to ensure a proper readiness ? Does anyone have
>>> recommendations on how to do this the right way ?
>>>
>>> See my Jenkinsfile here
>>> https://github.com/romain-grecourt/ee4j-glassfish/blob/0cb4600c17f3a875c451b343444b9d57b3ff3283/Jenkinsfile
>>> ; any feedback is welcome.
>>>
>>> Thanks,
>>> Romain
>>>
>>> 
>>>
>>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>>  Running shell script
>>>
>>> process apparently never started in 
>>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-3fb9a8c3
>>>
>>> script returned exit code -2
>>>
>>> 
>>>
>>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>>  Running shell script
>>>
>>> container [glassfish-ci] does not exist in pod [jenkins-slave-p3p21-whthx]
>>>
>>> 
>>>
>>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>>  Running shell script
>>>
>>> process apparently never started in 
>>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64
>>>
>>> sh: 1: cannot create 
>>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-log.txt:
>>>  Directory nonexistent
>>>
>>> sh: 1: cannot create 
>>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-result.txt.tmp:
>>>  Directory nonexistent
>>>
>>> mv: cannot stat 
>>> '/home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-result.txt.tmp':
>>>  No such file or directory
>>>
>>> script returned exit code -2
>>>
>>> 
>>>
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/CADhPohneMZ5%3Da2GPb5chSsjjRYctaJaDQbEXuKhBALO-N83o_A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/CADhPohneMZ5%3Da2GPb5chSsjjRYctaJaDQbEXuKhBALO-N83o_A%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PSQPDZ1h8n%2BKQ21EMqUnHKQmxrCn2JFHvjQurG032sFQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PSQPDZ1h8n%2BKQ21EMqUnHKQmxrCn2JFHvjQurG032sFQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>&g

Re: Kubernetes plugin - ready probe

2018-11-19 Thread Romain Grécourt
Unfortunately I don't have cluster access (eclipse policy) and this issue
is somewhat intermittent.
Will get back to you if/when I get these logs.

On Sun, Nov 18, 2018 at 11:56 PM Carlos Sanchez  wrote:

> you need to check your pod logs and k8s describe them to see what's the
> possible error
>
> On Sat, Nov 17, 2018 at 1:47 PM Romain Grécourt 
> wrote:
>
>> Hi,
>>
>> I'm doing a Jenkins pipeline with the kubernetes plugin (1.12.4).
>>
>> Currently facing some odd behaviors where steps are executed before the
>> pod is actually "ready". See some of the errors  I got below.
>>
>> One of the recurring error is about a non existing directory inside the
>> workspace, or the main container not existing in the pod.
>>
>> BTW, what's exit code -2 ?
>>
>> Looking at the pod definition I don't see any probe for the injected jnlp
>> container.
>> Should I define a probe to ensure a proper readiness ? Does anyone have
>> recommendations on how to do this the right way ?
>>
>> See my Jenkinsfile here
>> https://github.com/romain-grecourt/ee4j-glassfish/blob/0cb4600c17f3a875c451b343444b9d57b3ff3283/Jenkinsfile
>> ; any feedback is welcome.
>>
>> Thanks,
>> Romain
>>
>> 
>>
>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>  Running shell script
>>
>> process apparently never started in 
>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-3fb9a8c3
>>
>> script returned exit code -2
>>
>> 
>>
>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>  Running shell script
>>
>> container [glassfish-ci] does not exist in pod [jenkins-slave-p3p21-whthx]
>>
>> 
>>
>> [ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ]
>>  Running shell script
>>
>> process apparently never started in 
>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64
>>
>> sh: 1: cannot create 
>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-log.txt:
>>  Directory nonexistent
>>
>> sh: 1: cannot create 
>> /home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-result.txt.tmp:
>>  Directory nonexistent
>>
>> mv: cannot stat 
>> '/home/jenkins/workspace/ee4j-glassfish_ci-pipeline-YWJPM77PBRNTKWL4JGYGVAYHJW5MFPG52VIUHMUAGFIJ2G7NYJHQ@tmp/durable-fecb2d64/jenkins-result.txt.tmp':
>>  No such file or directory
>>
>> script returned exit code -2
>>
>> 
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CADhPohneMZ5%3Da2GPb5chSsjjRYctaJaDQbEXuKhBALO-N83o_A%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CADhPohneMZ5%3Da2GPb5chSsjjRYctaJaDQbEXuKhBALO-N83o_A%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PSQPDZ1h8n%2BKQ21EMqUnHKQmxrCn2JFHvjQurG032sFQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6PSQPDZ1h8n%2BKQ21EMqUnHKQmxrCn2JFHvjQurG032sFQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CADhPohk06Ri4U4jYjARxTxKE-iE19sCWqLDC9p-Ws3-D2WX8LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >