Re: Websocket support

2024-04-04 Thread Carlos Sanchez
Thanks, I couldn't find that doc

On Wednesday, April 3, 2024 at 10:15:33 PM UTC+2 Mark Waite wrote:

> On Wednesday, April 3, 2024 at 12:45:05 PM UTC-6 Carlos Sanchez wrote:
>
> Hi, 
>
> Trying to use websockets with the Kubernetes plugin I get "WebSocket 
> support is not enabled in this Jenkins installation" 
> I couldn't find much documentation but looking through the code [1] I 
> assume this is only supported in jetty10 and app server support is needed?
>
> Thanks
>
> [1] https://github.com/jenkinsci/jenkins/tree/master/websocket
>
>
>
> Websocket support works with the Jetty 10 that is bundled inside Jenkins.  
> It does not work with other containers (like Tomcat or WildFly).  The "Other 
> Servelt Containers" page 
> <https://www.jenkins.io/doc/book/installing/servlet-containers/> says:
>
> > In particular, support for WebSocket agents is only implemented for the 
> Jetty servlet container. 
>  
> Mark Waite
>

-- 
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/482c2fdd-edcf-4e6c-8232-9c0e25f1b707n%40googlegroups.com.


Websocket support

2024-04-03 Thread Carlos Sanchez
Hi, 

Trying to use websockets with the Kubernetes plugin I get "WebSocket 
support is not enabled in this Jenkins installation" 
I couldn't find much documentation but looking through the code [1] I 
assume this is only supported in jetty10 and app server support is needed?

Thanks

[1] https://github.com/jenkinsci/jenkins/tree/master/websocket



-- 
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/0d8e1801-9012-46e8-bfb4-d5b4d942d907n%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
> 
> ?  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
>>>  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
>>> 
>>> .
>>>
>> --
> 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
> 
> .
>

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

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


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

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


Re: k8s plugin

2019-12-03 Thread Carlos Sanchez
Yes, but

 yamlFile  './k8s/someyaml.yaml'

On Tue, Dec 3, 2019 at 11:41 AM YD  wrote:

> thanks Carlos , it did work fine when i copy the file (someyaml.yaml) to
> the root  of the repo
> can i put the file in some folder (same repo) and use something like below
> pipeline {
>   agent  {
> kubernetes
> {
>  yamlFile  '/k8s/someyaml.yaml'
> }
>   }
>
> On Monday, December 2, 2019 at 6:16:03 PM UTC+2, Carlos Sanchez wrote:
>>
>> No, It has to live in the same repo
>>
>> On Mon, Dec 2, 2019, 16:39 YD  wrote:
>>
>>> Hi all
>>>
>>> in kubernetes plugin i want to use yaml that i managed in my git server
>>> (public repo)
>>>
>>> does something like that should work ?
>>>
>>> pipeline {
>>>   agent  {
>>> kubernetes
>>>   {
>>>  yamlFile  '/someyaml.yaml'
>>> }
>>>   }
>>>
>>> if not what are my options for using yamlFile method
>>>
>>> thanks
>>> Yair
>>>
>>> --
>>> 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/fa6504d9-6371-4b20-a5f0-a8a8448896b2%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/fa6504d9-6371-4b20-a5f0-a8a8448896b2%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/0834c862-095b-4828-ac9b-76cf6d87ecde%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/0834c862-095b-4828-ac9b-76cf6d87ecde%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/CALHFn6OWX-Pbo_z10uMMFgx%2BPKX%2BY9yjNN_O9%3D%2BENN0iy3HuMg%40mail.gmail.com.


Re: k8s plugin

2019-12-02 Thread Carlos Sanchez
No, It has to live in the same repo

On Mon, Dec 2, 2019, 16:39 YD  wrote:

> Hi all
>
> in kubernetes plugin i want to use yaml that i managed in my git server
> (public repo)
>
> does something like that should work ?
>
> pipeline {
>   agent  {
> kubernetes
>   {
>  yamlFile  '/someyaml.yaml'
> }
>   }
>
> if not what are my options for using yamlFile method
>
> thanks
> Yair
>
> --
> 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/fa6504d9-6371-4b20-a5f0-a8a8448896b2%40googlegroups.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/CALHFn6PTmC6R4sZ%3DeKrs-6mL9LExPb6-SaO9US9uRApbWVS5Kg%40mail.gmail.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 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
> 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
> 

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

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


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


Re: Remote logging Kubernetes agents dying due to channel closed exception

2019-04-25 Thread Carlos Sanchez
you should look into the networking layer in your kubernetes cluster, it
may be aggressively closing connections

On Thu, Apr 25, 2019 at 8:34 PM Andrew Feller  wrote:

> We've been trying to troubleshoot OpenShift-support
>  Jenkins
> Kubernetes agents terminating due to closed channel exceptions and reaching
> for straws here.  We're considering enabling remote logging
>  as a
> last ditch effort to debug what is going on within the JNLP container,
> however I'm not sure how configuring -workDir
>  should
> take into account ephemeral Kubernetes pods for agents.
>
> Any help would be appreciated!
> --
>
> [image: BandwidthMaroon.png]
>
> Andy Feller  •  Sr DevOps Engineer
>
> 900 Main Campus Drive, Suite 500, Raleigh, NC 27606
>
>
> e: afel...@bandwidth.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/CAAg6KNENkQCCMSP4%2BOp99rxbcyGeSSjUA4-Fv_o8i1N4gsiJWQ%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/CALHFn6N1HsVKQ1Fm6CFXsJ-HN1p%2Bo28eCYR7NaYC%3DBvJ8L2C7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

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


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


Re: One Jenkins, Multiple Kubernetes Clusters

2019-03-07 Thread Carlos Sanchez
are you creating pod templates in UI or in pipeline?

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

On Wed, Mar 6, 2019 at 8:23 PM Steve Garrett 
wrote:

> Hi,
>
> I'm trying to use multiple kubernetes clouds and have just a single
> jenkins I was able to get both kubernetes clusters registered as clouds and
> all the login checks work. When I run a build to the cluster where
> Jenkins is, i
> t works fine, pulls code, builds an image and all that. However, when I
> change the label to my second cluster, that doesn't have any Jenkins there
> it seems to never want to build there and always builds on the cluster
> that's local to Jenkins.
>
> I'm missing something stupid I'm sure of it but don't see what it is.
>
>
> Thanks for your help
>
>
> Steve
>
> --
> 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/51ef6954-78a9-44cf-a4f0-0848fb0f5547%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/CALHFn6OXYBB0NXC%2BPZ3%2B7q-SnBxOpCausC0UNC2_JkRvdd7%2B9Q%40mail.gmail.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
> 
> .
> 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.


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: Prov of pod template failing with "Service account may have been revoked"

2019-01-22 Thread Carlos Sanchez
User "slc11yke_k8s_user" cannot get pods/log in the namespace "default".

On Tue, Jan 22, 2019, 09:59  wrote:

> Hi ,
> My Jenkins is running on a pod and is configured to K8S.
> when tried to run a  job .. Provision of the pod template failing with
> below error ..
> ===
>
> Waiting for agent to connect (99/100): k8s-pod-vfzmj
>
> Jan 22, 2019 8:30:30 AM WARNING 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher launch
>
> Error in provisioning; agent=KubernetesSlave name: k8s-pod-vfzmj, 
> template=PodTemplate{inheritFrom='', name='K8S_POD', namespace='default', 
> idleMinutes=3, label='K8S_LAB', nodeSelector='', nodeUsageMode=EXCLUSIVE, 
> workspaceVolume=EmptyDirWorkspaceVolume [memory=false], 
> containers=[ContainerTemplate{name='jnlp', 
> image='oraclelinuxjdk-jenkins-slave:14.0', privileged=true, 
> workingDir='/scratch/syseng', command='', args='', resourceRequestCpu='', 
> resourceRequestMemory='', resourceLimitCpu='', resourceLimitMemory='', 
> livenessProbe=org.csanchez.jenkins.plugins.kubernetes.ContainerLivenessProbe@641217ec}],
>  yaml=}
> io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: 
> GET at: 
> https://10.250.85.114:6443/api/v1/namespaces/default/pods/k8s-pod-vfzmj/log?pretty=false=jnlp=30.
>  Message: Forbidden!Configured service account doesn't have access. Service 
> account may have been revoked. pods "k8s-pod-vfzmj" is forbidden: User 
> "slc11yke_k8s_user" cannot get pods/log in the namespace "default".
>   at 
> io.fabric8.kubernetes.client.dsl.base.OperationSupport.requestFailure(OperationSupport.java:478)
>
> ==
> Any help would be great help..
> Regards,
> Basanta
>
> --
> 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/19217962-a508-4ede-85d5-e74d5bb7%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/CALHFn6M1saDQKz-RqkjrfRZPqhUNA1P7EaihUMZmLxDdiOHMQg%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-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.


Re: Kubernetes default jnlp container

2019-01-10 Thread Carlos Sanchez
You have to create a default PodTemplate and then put its name in the field
"Defaults Provider Template Name" in settings

On Thu, Jan 10, 2019 at 7:56 AM Maciej Gąsiorowski <
maciej.m.gasiorow...@gmail.com> wrote:

> Hi,
>
> It is possible to set custom default jnlp container (from private repo)
> for all jobs, without configuring him in all pipelines used in instance?
>
> I tried configure it in jenkins settings, but this don't work, job allways
> tried to pull imgage from hub.docker.
>
> Thanks,
> Maciej
>
> --
> 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/bf86a73e-3a1c-42d0-9c98-7b9a06fdd0c6%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/CALHFn6NPz294RT9OYhfE%2BTziRfqNrwAcPZDj0kdwfijndBJ-8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins slaves in multiple kubernetes cluster

2019-01-07 Thread Carlos Sanchez
check the logs
https://github.com/jenkinsci/kubernetes-plugin/#debugging



On Mon, Jan 7, 2019 at 9:07 AM Don Capito  wrote:

> No joy. Regardless whether Kubernetes URL is set to cluster1  (ie, jenkins
> master pod) or cluster2 (jenkins slave) IP, the jenkins slave pods are
> still launched in cluster1.
> Am I missing some setttings?
>
> On Fri, 4 Jan 2019 at 15:01, Carlos Sanchez  wrote:
>
>> master can be anywhere, on prem, vm, kubernetes,...
>> agents launch as pods
>>
>> On Fri, Jan 4, 2019 at 3:26 PM  wrote:
>>
>>> Does that mean there will be a pod for master on cluster1 and another
>>> pod for slave on cluster2?
>>>
>>> On Friday, 4 January 2019 14:17:58 UTC, Carlos Sanchez wrote:
>>>>
>>>> you can run agents in another cluster. You need to check the logs of
>>>> both master and pods to see if the pods can't connect back to the master
>>>>
>>>> On Fri, Jan 4, 2019 at 3:03 PM  wrote:
>>>>
>>>>> Hi,
>>>>> Not sure if this is even possible using the K8s plugin.
>>>>> We stood up a new K8s cluster and added its IP in Jenkins master
>>>>> config: Cloud -> Kubernetes -> Kubernetes URL.
>>>>> Tested Connection is OK.
>>>>>
>>>>> Filled the Jenkins URL with the Jenkins master IP, but when launching
>>>>> jobs, they're just stuck to the queue compared to running master/slave in 
>>>>> a
>>>>> single K8s cluster.
>>>>>
>>>>> Q: Is it even possible to run master on one K8s cluster and launch
>>>>> slaves on different clusters?
>>>>> Or the plugin is designed to run master and slaves on the same cluster?
>>>>>
>>>>> Thanks,
>>>>> Don
>>>>>
>>>>> --
>>>>> 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/590802bf-e490-40ec-b7b8-21e090c2432e%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/590802bf-e490-40ec-b7b8-21e090c2432e%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/83c4bd85-09bf-4272-b11d-6857fc217f6d%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/83c4bd85-09bf-4272-b11d-6857fc217f6d%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/CALHFn6My7LCNTWEdo%2BAjhti42PiXiwVYzi6%2BrqU%2BxQ1zS29aAQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6My7LCNTWEdo%2BAjhti42PiXiwVYzi6%2BrqU%2BxQ1zS29aAQ%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/CAN8ezqf2_yca%3D8B3QOV0VKEkHSW10SQeHqrY%2BxZqd17NoBGnZg%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAN8ezqf2_yca%3D8B3QOV0VKEkHSW10SQeHqrY%2BxZqd17NoBGnZg%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/CALHFn6M9xTZfNt5YCd%3DuC2goBkEOr4FuB2yu5CcUPnCU3%2Bpt%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins slaves in multiple kubernetes cluster

2019-01-04 Thread Carlos Sanchez
master can be anywhere, on prem, vm, kubernetes,...
agents launch as pods

On Fri, Jan 4, 2019 at 3:26 PM  wrote:

> Does that mean there will be a pod for master on cluster1 and another pod
> for slave on cluster2?
>
> On Friday, 4 January 2019 14:17:58 UTC, Carlos Sanchez wrote:
>>
>> you can run agents in another cluster. You need to check the logs of both
>> master and pods to see if the pods can't connect back to the master
>>
>> On Fri, Jan 4, 2019 at 3:03 PM  wrote:
>>
>>> Hi,
>>> Not sure if this is even possible using the K8s plugin.
>>> We stood up a new K8s cluster and added its IP in Jenkins master config:
>>> Cloud -> Kubernetes -> Kubernetes URL.
>>> Tested Connection is OK.
>>>
>>> Filled the Jenkins URL with the Jenkins master IP, but when launching
>>> jobs, they're just stuck to the queue compared to running master/slave in a
>>> single K8s cluster.
>>>
>>> Q: Is it even possible to run master on one K8s cluster and launch
>>> slaves on different clusters?
>>> Or the plugin is designed to run master and slaves on the same cluster?
>>>
>>> Thanks,
>>> Don
>>>
>>> --
>>> 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/590802bf-e490-40ec-b7b8-21e090c2432e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/590802bf-e490-40ec-b7b8-21e090c2432e%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/83c4bd85-09bf-4272-b11d-6857fc217f6d%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/83c4bd85-09bf-4272-b11d-6857fc217f6d%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/CALHFn6My7LCNTWEdo%2BAjhti42PiXiwVYzi6%2BrqU%2BxQ1zS29aAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins slaves in multiple kubernetes cluster

2019-01-04 Thread Carlos Sanchez
you can run agents in another cluster. You need to check the logs of both
master and pods to see if the pods can't connect back to the master

On Fri, Jan 4, 2019 at 3:03 PM  wrote:

> Hi,
> Not sure if this is even possible using the K8s plugin.
> We stood up a new K8s cluster and added its IP in Jenkins master config:
> Cloud -> Kubernetes -> Kubernetes URL.
> Tested Connection is OK.
>
> Filled the Jenkins URL with the Jenkins master IP, but when launching
> jobs, they're just stuck to the queue compared to running master/slave in a
> single K8s cluster.
>
> Q: Is it even possible to run master on one K8s cluster and launch slaves
> on different clusters?
> Or the plugin is designed to run master and slaves on the same cluster?
>
> Thanks,
> Don
>
> --
> 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/590802bf-e490-40ec-b7b8-21e090c2432e%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/CALHFn6P%3DE%3D3018-mW8uS6dzSLD20LtMV8xSUsOCi95YF5QePtA%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 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 - 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
> 
> .
> 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.


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


Re: jenkins kubernetes yaml reference

2018-11-29 Thread Carlos Sanchez
You can find the YAML reference in kubernetes docs

On Thu, Nov 29, 2018, 17:27 nirav  wrote:

> Is there a reference document where this is documented in detail for each
> kind of kubernete entity - pod, service, deployment
>
> In past several months I saw 3 to 4 different style of defining this. It
> has been so confusing to define. seems like yaml is the latest new and
> "better" approach then pod templates. even in yaml there's different spec
> exists based on apiVersion.
>
> So is there any location where we know which one is latest spec and which
> one are previous. as part of release notes or as part of reference docs for
> each version.
>
>
> --
> 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/0c84f5e0-74dd-4cb0-94e5-3e7173798638%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/CALHFn6NG684vta9KncrQpfazmNaNfyR4fqFVmBDvvtp6%2BO6PaA%40mail.gmail.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-18 Thread Carlos Sanchez
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
> 
> .
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: custom image for jnlp( amazonlinux)

2018-11-15 Thread Carlos Sanchez
See

Agent is not connected after 30 attempts, status: Running

check your agent pod logs for errors. They should also show in the jenkins
master log



On Tue, Nov 13, 2018 at 11:36 PM Yaramada Surya tej 
wrote:

> Here is the error logs while using custom image
>
> Error in provisioning; agent=KubernetesSlave name: eks-cluster-qwx9k,
> template=PodTemplate{inheritFrom='', name='eks-cluster', namespace='',
> slaveConnectTimeout=30, label='eks-cluster', nodeSelector='',
> nodeUsageMode=NORMAL, workspaceVolume=EmptyDirWorkspaceVolume
> [memory=false], containers=[ContainerTemplate{name='jnlp', image='
> 999.dkr.ecr.us-east-1.amazonaws.com/jenkinsci-jnlp-slave',
> workingDir='/home/jenkins', command='', args='cat', ttyEnabled=true,
> resourceRequestCpu='', resourceRequestMemory='', resourceLimitCpu='',
> resourceLimitMemory='',
> livenessProbe=org.csanchez.jenkins.plugins.kubernetes.ContainerLivenessProbe@4a17bf41},
> ContainerTemplate{name='kubectl-helm', image='
> 250312325083.dkr.ecr.us-east-1.amazonaws.com/kubectl-helm:latest',
> workingDir='/home/jenkins', command='/bin/sh -c', args='cat',
> ttyEnabled=true, resourceRequestCpu='', resourceRequestMemory='',
> resourceLimitCpu='', resourceLimitMemory='',
> livenessProbe=org.csanchez.jenkins.plugins.kubernetes.ContainerLivenessProbe@3a0ad6a5},
> ContainerTemplate{name='java-base-image', image='
> 999.dkr.ecr.us-east-1.amazonaws.com/java8:latest',
> workingDir='/home/jenkins', command='/bin/sh -c', args='cat',
> ttyEnabled=true, resourceRequestCpu='', resourceRequestMemory='',
> resourceLimitCpu='', resourceLimitMemory='',
> livenessProbe=org.csanchez.jenkins.plugins.kubernetes.ContainerLivenessProbe@42ca15d6}],
> yaml=} java.lang.IllegalStateException: Agent is not connected after 30
> attempts, status: Running at
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:190)
> at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:294) 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) Nov 13, 2018 7:58:06 PM INFO
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
> Terminating Kubernetes instance for agent eks-cluster-qwx9k Nov 13, 2018
> 7:58:06 PM WARNING io.fabric8.kubernetes.client.Config tryServiceAccount
> Error reading service account token from: [/var/run/secrets/
> kubernetes.io/serviceaccount/token]. Ignoring. Nov 13, 2018 7:58:06 PM
> INFO okhttp3.internal.platform.Platform log ALPN callback dropped: HTTP/2
> is disabled. Is alpn-boot on the boot class path? Nov 13, 2018 7:58:06 PM
> INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave deleteSlavePod
> Terminated Kubernetes instance for agent default/eks-cluster-qwx9k Nov 13,
> 2018 7:58:06 PM INFO
> org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave _terminate
> Disconnected computer eks-cluster-qwx9k Nov 13, 2018 7:58:09 PM INFO
> org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud provision Excess
> workload after pending Kubernetes agents: 1 Nov 13, 2018 7:58:09 PM INFO
> org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud provision Template
> for label eks-cluster: Kubernetes Pod Template Nov 13, 2018 7:58:09 PM
> WARNING io.fabric8.kubernetes.client.Config tryServiceAccount Error reading
> service account token from: [/var/run/secrets/
> kubernetes.io/serviceaccount/token]. Ignoring. Nov 13, 2018 7:58:09 PM
> INFO okhttp3.internal.platform.Platform log ALPN callback dropped: HTTP/2
> is disabled. Is alpn-boot on the boot class path? Nov 13, 2018 7:58:09 PM
> INFO hudson.slaves.NodeProvisioner$StandardStrategyImpl apply Started
> provisioning Kubernetes Pod Template from kubernetes with 1 executors.
> Remaining excess workload: 0 Nov 13, 2018 7:58:19 PM WARNING
> io.fabric8.kubernetes.client.Config tryServiceAccount Error reading service
> account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token].
> Ignoring. Nov 13, 2018 7:58:19 PM INFO hudson.slaves.NodeProvisioner$2 run
> Kubernetes Pod Template provisioning successfully completed. We have now 3
> computer(s) Nov 13, 2018 7:58:19 PM INFO okhttp3.internal.platform.Platform
> log ALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot
> class path?
>
> On Tuesday, 13 November 2018 01:06:24 UTC-5, Yaramada Surya tej wrote:
>>
>> Hi, I am trying to use custom image which is based on amazonlinux and
>> pushed to ECR for running jenkins executors on AWS EKS. able to use
>> default image ( alpine) but need help to configure in settings for using a
>> custom image.
>>
>> To achieve this do we need 2 custom 

Re: Pod still released after "Pod Retention" set to "On Failure" for Kubernetes Plugin

2018-11-02 Thread Carlos Sanchez
When you say "pod still released" what do you mean? the retention means the
pod will not be deleted in k8s but not used by jenkins

On Fri, Nov 2, 2018 at 9:58 AM Evan  wrote:

> Jenkins 2.138.2
>
> Kubernetes Plugin 1.13.2
>
>
>
> When using kubernetes plugin to dynamically provision Jenkins slave, the
> needs now is to reserve workspace of Jenkins slave when the job failed,
> "Pod Retention" seems to be useful.
>
>
>
> When "Pod Retention" is set to "Always", after job finished, the pod is
> reserved;
>
>
> But when "Pod Retention" set to "On Failure", after job fails, the pod
> still released.
>
>
> Is it a bug of plugin or my setting problem?
>
> --
> 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/334d2195-3ace-4ed0-81ba-2ae77958d3d7%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/CALHFn6NR%3DrqeZ%2BAUEHv5V3hgNShja7QrW7CSef6aeXtxGPJR3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to build in specify container in freestyle job when using Kubernetes plugin?

2018-10-29 Thread Carlos Sanchez
you can't, you can only do it with pipeline jobs

On Mon, Oct 29, 2018 at 1:56 PM 徐志远  wrote:

> I set up a Container Template as follows, and want to execute shell in it
>
>
> [image: Untitled picture.png]
>
>
>
> but when I use label "pyenv" in freestyle job and use python, I got error
> message:
>
> + whoami
>
> jenkins
>
> + python -V
>
> python: command not found
>
> + pip install python-jenkins
>
> line 17: pip: command not found
>
>
>
> it seems the script run in "jnlp container", instead of "python
> container".
>
>
>
> I searched a lot and found "container" argument could be defined in
> "pipeline", but how can I specify to build in certain container in
> freestyle job?
>
> --
> 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/253c79b2-bc5a-4b9d-ae51-f079d9fb0d37%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/CALHFn6Mw5Ymc3q%3DAS1f1ObLWqjfib9oJdLxMvpposhawV1wxyA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: pod inter connections inside k8s cluster

2018-09-17 Thread Carlos Sanchez
You need to use services if you want to expose pods
If you put everything in one pod, you can use localhost to talk between
containers

On Mon, Sep 17, 2018, 18:57 JonathanRRogers 
wrote:

>
>
> On Monday, September 17, 2018 at 11:29:33 AM UTC-4, Tristan FAURE wrote:
>>
>> Hello,
>> I need your advice, i want to achieve integration tests using several
>> pods :
>>
>> pod 1 : database postgresql
>> pod 2 : build with maven image and test using a connection to pod 2
>>
>> To implement that I wanted to use IP address (with
>> ip.namespace.pod.cluster.local) of pod1, but I don't know if it is the
>> recommended way, and if it is i don't know how to get this IP address
>>
>> I have seen that I can have my pod agent name using env JENKINS_AGENT_NAME
>> but I don't know what is the best to share it from stages of pod1 in env
>> of pod2
>>
>
> This is more of a Kubernetes question than a Jenkins one. I am running
> Jenkins inside a K8S cluster and I'm not aware of anything Jenkins-specific
> that will do what you want. I use K8S clients including kubectl and the
> Python "kubernetes" package to query and manipulate objects directly. I run
> Postgres as a statefulset with a service so that any Jenkins slave running
> in the same K8S namespace can connect to it using the service name as
> hostname. Jenkins can run any external command you want, so which client
> executable or library makes the most sense depends on your experience and
> what you're trying to accomplish.
>
> --
> 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/21112f04-0cbc-4680-b763-102dfd030dca%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/CALHFn6Ptb8PKa0NQgN7WKNLHZd1Uu156dYrO5BfnnhcTAWo47w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins is not getting connected to my kubernetes without authentication.

2018-09-10 Thread Carlos Sanchez
that's a known issue but doesn't affect plugin operation
https://issues.jenkins-ci.org/browse/JENKINS-52912


On Mon, Sep 10, 2018 at 9:26 AM  wrote:

> Hi ,
> Using  Jenkins ver. 2.121.3 and Kubernetes plugin : 1.12.6.
>
> "Manage jenkins" -> "Configure system" , in the cloud section the "Max
> connections to Kubernetes API" is set to the default 32.
>
> But i am getting error in here and the jenkins is not getting connected to
> my kubernetes without authentication.
>
> The error says
>
> This URL requires POST
>
> The URL you're trying to access requires that requests be sent using POST
> (like a form submission). The button below allows you to retry accessing
> this URL using POST. URL being accessed:
>
>
> http://hudsonci.oraclecorp.com/jenkins/fmwsyseng_paas_stage/descriptorByName/org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud/checkMaxRequestsPerHostStr?value=32
>
> *If you were sent here from an untrusted source, please proceed with
> caution.*
> Retry using POST
>
> --
> 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/20212c61-3833-4719-92e0-53f678697162%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/CALHFn6Mypcan2HJ9mW4ZRzfnfwDHvfd98ykL%3D_tKpR_vf%3DTrgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use containerTemplates in declarative kubernetes agent definition

2018-09-08 Thread Carlos Sanchez
https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#declarative-pipeline

Note that it was previously possible to define containerTemplate but that
has been deprecated in favor of the yaml format.

containerTemplates also works but yaml syntax is preferred



On Sat, Sep 8, 2018 at 12:56 AM Matt Buckland 
wrote:

> Hello list,
>
> I'm running jenkins inside k8s:
> jenkins/jenkins:lts
> jenkins/jnlp-slave:3.23-1
> kubernetes-plugin: 1.12.4
>
> I'm using the following to define my agent:
>
>   agent {
> kubernetes {
>   label "${JOB_NAME}"
>   inheritFrom 'default'
>   containerTemplate {
> name 'jnlp'
> image '${ACCOUNT_ID}.dkr.ecr.${REGION}.
> amazonaws.com/jenkins/jnlp-slave:${AGENT_IMAGE_TAG}
> '
> resourceRequestCpu '200m'
> resourceLimitCpu '1'
> resourceRequestMemory '256Mi'
> resourceLimitMemory '1Gi'
>   }
>
>
>
> In the logs I have this message:
>
> Sep 07, 2018 5:11:34 PM
> org.csanchez.jenkins.plugins.kubernetes.pipeline.KubernetesDeclarativeAgent
> getAsArgs
> WARNING: containerTemplate option in declarative pipeline is deprecated,
> use containerTemplates
>
>
> I've not been able to find any documentation or examples showing how to
> use this containerTemplates option (note the "s" on the end). I've tried
> things such as:
>
>   containerTemplates [
> containerTemplate {
>   name 'jnlp'
>   image '${ACCOUNT_ID}.dkr.ecr.${REGION}.
> amazonaws.com/jenkins/jnlp-slave:${AGENT_IMAGE_TAG}
> '
>   resourceRequestCpu '200m'
>   resourceLimitCpu '1'
>   resourceRequestMemory '256Mi'
>   resourceLimitMemory '1Gi'
> }
>   ]
>
>
> and various other combinations, but I can't get it to work.
>
> Anyone have any suggestions?
>
> Many thanks,
>
> Matt
>
> --
> 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/c98259fd-1aa4-40a1-890d-cb157cf3bf5b%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/CALHFn6MkJMQsSudHjs55zADR%2BQWhJT_HCqZM_RBGKaDrScUmfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: declarative pod throwing error, following examples exactly...

2018-08-31 Thread Carlos Sanchez
Extra : after cat

On Thu, Aug 30, 2018, 23:39 Gabe Nydick  wrote:

> Config below, getting the error immediately below. I'm interpreting the
> error as the yaml is malformed, but it doesn't appear to be.
>
> hudson.remoting.ProxyException:
> com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize
> instance of java.lang.String out of START_OBJECT token
>
>  at [Source: java.io.BufferedInputStream@27e9e2dc; line: 12, column: 7]
> (through reference chain:
> io.fabric8.kubernetes.api.model.Pod["spec"]->io.fabric8.kubernetes.api.model.PodSpec["containers"]->java.util.ArrayList[0]->io.fabric8.kubernetes.api.model.Container["command"]->java.util.ArrayList[0])
>
>
> ipeline {
>   agent {
> kubernetes {
>   label 'jenkins-builder'
>   defaultContainer 'jnlp'
>   yaml """
> apiVersion: v1
> kind: Pod
> metadata:
>   labels:
> jenkins: slave
> spec:
>   containers:
>   - name: kubectl
> image: 850790058557.dkr.ecr.us-west-2.amazonaws.com/kubectl:latest
> command:
> - cat:
> tty: true
>   - name: helm
> image: 850790058557.dkr.ecr.us-west-2.amazonaws.com/helm:latest
> command:
> - cat:
> tty: true
> """
> }
>
> --
> 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/CACTWNKBvdB38Kx2kq340J8cQrHp3KsJ2WumsFxi64o5aMBz_vQ%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/CALHFn6Pmk9Xz0APb9HrLiSaCaUB783gHmRMi1uaNQHv_m9%2BZyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multi-branch pipeline / kubernetes stage probem

2018-08-29 Thread Carlos Sanchez
the jnlp container needs to execute the jenkins agent, not cat

On Wed, Aug 29, 2018 at 6:41 PM Gabe Nydick  wrote:

> What was wrong about using 'cat' there? is it just the wrong health check?
>
> On Wed, Aug 29, 2018 at 8:20 AM, Gabe Nydick  wrote:
>
>> ha! good catch.
>>
>> On Wed, Aug 29, 2018 at 12:36 AM, Carlos Sanchez 
>> wrote:
>>
>>> Your example wouldn't even work, the jnlp container definition is wrong,
>>> can't use cat there
>>>
>>> containerTemplate(name: 'jnlp', image: '', command: 'cat', 
>>> ttyEnabled: true)
>>>
>>>
>>> and then you try to use container('jenkins-agent') which is not defined
>>>
>>>
>>> On Wed, Aug 29, 2018 at 12:59 AM Gabe Nydick  wrote:
>>>
>>>> My Jenkinsfile is below...
>>>>
>>>> There are 3 containers defined, each with their appropriate docker
>>>> image. There are 3 stages defined, each one exclusively uses one of the
>>>> containers.
>>>>
>>>> While exec'd into all of the containers, each one of them have a
>>>>
>>>> workspace/@/durable-/script.sh
>>>>
>>>> the contents of that script in all three containers is the script from
>>>> the stage called 'Create Docker Images'.
>>>>
>>>> When that stage completes, jenkins moves on to the next stage, but then
>>>> the durable- directory is gone. I then get the following error,
>>>> which makes sense.
>>>>
>>>> sh: 
>>>> /home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp/durable-170e31a9/script.sh:
>>>>  not found
>>>>
>>>>
>>>>
>>>> Did I author the Jenkinsfile incorrectly or is this a bug in the
>>>> pipeline?
>>>>
>>>>
>>>>
>>>> def label = "jenkins-builder-${UUID.randomUUID().toString()}"
>>>>
>>>> podTemplate(label: label, inheritFrom: 'jenkins-builder', containers: [
>>>>   containerTemplate(name: 'kubectl', image: '', command: 'cat', 
>>>> ttyEnabled: true),
>>>>   containerTemplate(name: 'helm', image: '', command: 'cat', 
>>>> ttyEnabled: true),
>>>>   containerTemplate(name: 'jnlp', image: '', command: 'cat', 
>>>> ttyEnabled: true)
>>>> ],
>>>>   volumes: [
>>>> hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: 
>>>> '/var/run/docker.sock')
>>>>   ]) {
>>>>   node(label) {
>>>> def myRepo = checkout scm
>>>> def gitCommit = myRepo.GIT_COMMIT
>>>> def gitBranch = myRepo.GIT_BRANCH
>>>> def shortGitCommit = "${gitCommit[0..10]}"
>>>> def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", 
>>>> returnStdout: true)
>>>>
>>>> stage('Create Docker images') {
>>>>   container('jenkins-agent') {
>>>> sh """
>>>>   \$(aws ecr get-login --no-include-email --region=us-west-2 | sed 
>>>> 's/-e none//')
>>>>   docker build -t :${gitCommit} . -f base.Dockerfile
>>>>   docker push :${gitCommit}
>>>>   """
>>>>   }
>>>> }
>>>> stage('Run kubectl') {
>>>>   container('kubectl') {
>>>> sh "kubectl get pods"
>>>>   }
>>>> }
>>>> stage('Run helm') {
>>>>   container('helm') {
>>>> sh "helm list"
>>>>   }
>>>> }
>>>>   }
>>>> }
>>>>
>>>>
>>>>
>>>> --
>>>> 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/CACTWNKBkGhor-cLVO_oFNCN8hp-X7r%2BiK6dDcJowvGTyAsOLkw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CACTWNKBkGhor-cLVO_oFNCN8hp-X7r%2BiK6dDcJowvGTyAsOLkw%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout

Re: multi-branch pipeline / kubernetes stage probem

2018-08-29 Thread Carlos Sanchez
Your example wouldn't even work, the jnlp container definition is wrong,
can't use cat there

containerTemplate(name: 'jnlp', image: '', command: 'cat',
ttyEnabled: true)


and then you try to use container('jenkins-agent') which is not defined


On Wed, Aug 29, 2018 at 12:59 AM Gabe Nydick  wrote:

> My Jenkinsfile is below...
>
> There are 3 containers defined, each with their appropriate docker image.
> There are 3 stages defined, each one exclusively uses one of the containers.
>
> While exec'd into all of the containers, each one of them have a
>
> workspace/@/durable-/script.sh
>
> the contents of that script in all three containers is the script from the
> stage called 'Create Docker Images'.
>
> When that stage completes, jenkins moves on to the next stage, but then
> the durable- directory is gone. I then get the following error,
> which makes sense.
>
> sh: 
> /home/jenkins/workspace/h_ci-cd_dev_2018-08-13-kube-B25Q2OMNNSNLLVD3BXC7FMQBF3IKQYJE4OSTUSVSM65SZ6NCGBAQ@tmp/durable-170e31a9/script.sh:
>  not found
>
>
>
> Did I author the Jenkinsfile incorrectly or is this a bug in the pipeline?
>
>
>
> def label = "jenkins-builder-${UUID.randomUUID().toString()}"
>
> podTemplate(label: label, inheritFrom: 'jenkins-builder', containers: [
>   containerTemplate(name: 'kubectl', image: '', command: 'cat', 
> ttyEnabled: true),
>   containerTemplate(name: 'helm', image: '', command: 'cat', 
> ttyEnabled: true),
>   containerTemplate(name: 'jnlp', image: '', command: 'cat', 
> ttyEnabled: true)
> ],
>   volumes: [
> hostPathVolume(mountPath: '/var/run/docker.sock', hostPath: 
> '/var/run/docker.sock')
>   ]) {
>   node(label) {
> def myRepo = checkout scm
> def gitCommit = myRepo.GIT_COMMIT
> def gitBranch = myRepo.GIT_BRANCH
> def shortGitCommit = "${gitCommit[0..10]}"
> def previousGitCommit = sh(script: "git rev-parse ${gitCommit}~", 
> returnStdout: true)
>
> stage('Create Docker images') {
>   container('jenkins-agent') {
> sh """
>   \$(aws ecr get-login --no-include-email --region=us-west-2 | sed 
> 's/-e none//')
>   docker build -t :${gitCommit} . -f base.Dockerfile
>   docker push :${gitCommit}
>   """
>   }
> }
> stage('Run kubectl') {
>   container('kubectl') {
> sh "kubectl get pods"
>   }
> }
> stage('Run helm') {
>   container('helm') {
> sh "helm list"
>   }
> }
>   }
> }
>
>
>
> --
> 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/CACTWNKBkGhor-cLVO_oFNCN8hp-X7r%2BiK6dDcJowvGTyAsOLkw%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/CALHFn6NyexPrjDeT_%3DszNHVF6391uDNdqsb3N04V5BEKS%3D4%2BEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: working kubernetes cloud not available in multi-branch pipeline

2018-08-28 Thread Carlos Sanchez
It depends on what are you trying to do which is not clear. If you are
building a pipeline job you need to use

node(label) {}
or in declarative
agent { label 'my-defined-label' }

or use the k8s plugin pipeline capabilities

see
https://wiki.jenkins.io/display/JENKINS/Distributed+builds#Distributedbuilds-Usinglabels
https://jenkins.io/doc/book/pipeline/syntax/#agent
https://github.com/jenkinsci/kubernetes-plugin/


On Tue, Aug 28, 2018 at 10:02 PM Gabe Nydick  wrote:

> Oh, and which plugin, is this a kubernetes plugin issue or multi-branch?
>
> On Tue, Aug 28, 2018 at 1:01 PM, Gabe Nydick  wrote:
>
>> I don't see where I can add labels to my job.
>>
>> On Tue, Aug 28, 2018 at 1:00 PM, Gabe Nydick  wrote:
>>
>>> Exactly that section. So I have to add labels to my multi-branch job to
>>> match the labels in the template?
>>>
>>> On Tue, Aug 28, 2018 at 12:53 PM, Carlos Sanchez 
>>> wrote:
>>>
>>>> > When I configure a multi-branch pipeline, the Kubernetes cluster
>>>> section
>>>>
>>>> are you talking about the section that says "Allow pipeline support
>>>> for the following restricted Kubernetes Clouds"
>>>> that's only for security restrictions
>>>>
>>>> You have to check what labels do you have defined in your pod template
>>>> config and what labels your job uses. Check the logs for more detailed
>>>> info, see debugging section in the plugin readme
>>>>
>>>>
>>>> On Tue, Aug 28, 2018 at 8:54 PM Gabe Nydick  wrote:
>>>>
>>>>> I have a successfully configured kubernetes cluster that runs my build
>>>>> jobs. When I configure a multi-branch pipeline, the Kubernetes cluster
>>>>> section just has ' -- none -- '. The multi-branch pipeline still runs, but
>>>>> it has errors that are in a different topic email, so I'll keep that 
>>>>> there,
>>>>> but instead of using the pod template that runs all of the freestyle jobs,
>>>>> this one uses some other template that I can't find, maybe it's a default
>>>>> in the plugin code.
>>>>>
>>>>> Thanks
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Jenkins Users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jenkinsci-users/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFpoS3XRUy1pt2FQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CACTWNKCvtmNXpbG-8uA3A4HPSq%3DuXCztpiXFpoS3XRUy1pt2FQ%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/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKBfB5EYTp_egw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6OTvFjB7KT_ZjKkUmHgzGkAHbw1cVp5fKBfB5EYTp_egw%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/CACTWNKBZ%2BaEVZL_JdpY8a%2B59m8MTBgWtMtVvQCsmFpT0r8y7Tg%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CACTWNKBZ%2BaEVZL_JdpY8a%2B59m8MTBgWtMtVvQCsmFpT0r8y7Tg%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/CALHFn6PwNu7z523OTQCavSBne%2Bcpq1WQHwxRus-w-5J%3DKnCBpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Volume issue with kubernetes plugin in declarative way (1.6.0 and 1.9.2)

2018-08-24 Thread Carlos Sanchez
On Fri, Aug 24, 2018 at 11:14 AM Tristan FAURE 
wrote:

>
>
> Le ven. 24 août 2018 à 11:09, Carlos Sanchez  a écrit :
>
>>
>>
>> On Fri, Aug 24, 2018 at 10:42 AM Tristan FAURE 
>> wrote:
>>
>>> Hello
>>>
>>> in my jenkins configuration admin GUI I have this volume definition :
>>>
>>> Volumes
>>> - Claim Name = nfsdata
>>> Read Only = true
>>> Mount path = /etc/ssl/certs
>>>
>>> In scripted pipeline everything works perfectly
>>>
>>> In declarative pipeline :
>>> pipeline {
>>> agent {
>>> kubernetes {
>>> label "${jedi}"
>>> yaml """
>>> spec:
>>> containers:
>>> - name: maven
>>> image: maven:3-jdk-8
>>> command:
>>> - cat
>>> tty: true
>>> """
>>>
>>> When i check the generated yaml in kubernetes, the volume is mounted
>>> only on the jnlp container and not the maven one
>>>
>>
>> how do you define that this pipeline uses the volume defined in the GUI?
>> using Defaults Provider Template Name?
>>
> I don't know if I answer the question. This pipeline is inside my
> jenkinsfile, I got the name analyzing my kubernetes cluster. The Volume
> mount has been defined using the administration GUI
>

this pipeline does not define any volume and it will not use any volume
defined in the GUI. This definition is independent of what you configure in
the GUI unless you use "Defaults Provider Template Name" in the GUI, but I
don't recommend you to do so.
I suggest you put the volume definition in the yaml for completion and
reproducibility


>
>>
>>>
>>> I need to write this to make it work and I don't really like this :
>>> yaml """
>>> spec:
>>> containers:
>>> - name: maven
>>> image: docker-ccsl-virtual.repo.aes.alcatel.fr:8443/maven:3-jdk-8
>>> command:
>>> - cat
>>> tty: true
>>> volumeMounts:
>>> - mountPath: /etc/ssl/certs
>>> name: volume-0
>>> readOnly : true
>>> """
>>>
>>> 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/fc9b3c60-aa86-491e-acf9-d9c6b09ecc06%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/fc9b3c60-aa86-491e-acf9-d9c6b09ecc06%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/8RnJ7fozEdo/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/CALHFn6M1tx684wFzNoHqiLZhHoySvM2V6JvcO%3DTz%3D7gUNkFrXQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6M1tx684wFzNoHqiLZhHoySvM2V6JvcO%3DTz%3D7gUNkFrXQ%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%2BtQ8YMV8oKt5csyLfWu9zwi3UU2%3DsNk%3DiMy95y2qGoAyqyMFw%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CA%2BtQ8YMV8oKt5csyLfWu9zwi3UU2%3DsNk%3DiMy95y2qGoAyqyMFw%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/CALHFn6N%3Dmbh%3DF7VwfgbR4AY-Y3x%2BqEw0jXrMb_f8jM2NZb1m4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Some issues with env vars with kubernetes plugin declarative (1.6.0 and 1.9.2)

2018-08-24 Thread Carlos Sanchez
1 and 2 should work for sure, we have a test for env vars

https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/test/resources/org/csanchez/jenkins/plugins/kubernetes/pipeline/runWithEnvVars.groovy



On Fri, Aug 24, 2018 at 10:27 AM Tristan FAURE 
wrote:

> Hello,
> I'm waiting for your feedback before opening a bug
>
> for information I have seen this SO post :
> https://stackoverflow.com/questions/45372798/jenkins-kubernetes-plugin-not-passing-environment-variables-with-pipeline
> and some others but I can't figure out why it is not working
>
> My jenkins configuration (admin):
> EnvVars
> Evironment variable :
> key : MAVEN_OPTS
> Value : -Djavax.net.ssl.trustStore=/etc/ssl/certs/cacerts
>
> my jenkinsfile :
>
> def label = "pod-${UUID.randomUUID().toString()}"
> pipeline {
> agent {
> kubernetes {
> label "${label }"
> yaml """
> spec:
> containers:
> - name: maven
> image: maven:3-jdk-8
> command:
> - cat
> tty: true
> """
> }
> }
> stages {
> stage('Run maven') {
> steps {
> sh 'set'
> //1
> sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
> container('maven') {
> // 2
> sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
> script {
> configFileProvider([configFile(fileId: 'maven_artifactory', variable:
> 'MAVEN_SETTINGS')]) {
> // 3
> sh 'echo MAVEN_OPTS = ${MAVEN_OPTS}'
> }
> }
> }
> }
> }
> }
> }
>
>
> Everything is OK in the YAML when i check on my kubernetes cluster
>
> but at execution echo MAVEN_OPTS works only in the first case
>
> 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/b0469a40-1557-4766-b348-033a669ddfe3%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/CALHFn6O%2B6ncntGDMfx9H-FWdWf8UcDs0Kka4vzOD46RZjXeU1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Volume issue with kubernetes plugin in declarative way (1.6.0 and 1.9.2)

2018-08-24 Thread Carlos Sanchez
On Fri, Aug 24, 2018 at 10:42 AM Tristan FAURE 
wrote:

> Hello
>
> in my jenkins configuration admin GUI I have this volume definition :
>
> Volumes
> - Claim Name = nfsdata
> Read Only = true
> Mount path = /etc/ssl/certs
>
> In scripted pipeline everything works perfectly
>
> In declarative pipeline :
> pipeline {
> agent {
> kubernetes {
> label "${jedi}"
> yaml """
> spec:
> containers:
> - name: maven
> image: maven:3-jdk-8
> command:
> - cat
> tty: true
> """
>
> When i check the generated yaml in kubernetes, the volume is mounted only
> on the jnlp container and not the maven one
>

how do you define that this pipeline uses the volume defined in the GUI?
using Defaults Provider Template Name?


>
> I need to write this to make it work and I don't really like this :
> yaml """
> spec:
> containers:
> - name: maven
> image: docker-ccsl-virtual.repo.aes.alcatel.fr:8443/maven:3-jdk-8
> command:
> - cat
> tty: true
> volumeMounts:
> - mountPath: /etc/ssl/certs
> name: volume-0
> readOnly : true
> """
>
> 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/fc9b3c60-aa86-491e-acf9-d9c6b09ecc06%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/CALHFn6M1tx684wFzNoHqiLZhHoySvM2V6JvcO%3DTz%3D7gUNkFrXQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin configuration using groovy

2018-08-20 Thread Carlos Sanchez
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-users+unsubscr...@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
> 
> .
> 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/CALHFn6MRvWO5uoVB-CJKuoAA_Qmwv_NZtkx1%2Buy4o3YbJViKow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: parallel stages using multiple pod (with Kubernetes plugin)

2018-05-24 Thread Carlos Sanchez
if you want to use the same template this should work

podTemplate(label: 'm1')
{
  stage('sync') {
parallel A: {
  node('m1') {
sync
  }
},
B: {
  node('m1') {
sync
  }
}
  }
}


If they are different, move the podTemplate to the parallel section

{
  stage('sync') {
parallel A: {
  podTemplate(label: 'm1')
  node('m1') {
sync
  }}
},
B: {
  podTemplate(label: 'm2') {
  node('m2') {
sync
  }}
}
  }
}



On Thu, May 24, 2018 at 2:57 PM 이호광  wrote:

> Hello.
>
> In the master branch, my code has feature flags (a.k.a feature toggles).
>
> So, I want to make a pipeline like
>
> start - sync - build - test - end
> - sync - build - test -
> - sync - build - test -
>
> (if there are 3 feature sets)
>
> sync is like git clone, and code is same or can be little bit different.
> and build command also can be slightly different for using feature flags.
>
> and when compiling, I use make -j (multi-processing) command.
>
>
> So I think creating one pod and multiple containers in Jenkins is not good
> idea due to heavy CPU and memory needed.
>
>
> I think Jenkins should be able to create multiple pods. Am I right?
>
>
> Is it possible ?
>
>
>
> In scripted pipeline, I create two container in a one pod successfully.
> But I don't know create two pods.
>
>
> podTemplate(
>
> label: 'mypod',
>
> containers: [
>
> containerTemplate(name: 'm1', image: 'maven', ttyEnabled: true, command:
> 'cat'),
>
> containerTemplate(name: 'm2', image: 'maven', ttyEnabled: true, command:
> 'cat')
>
> ],
>
> volumes: [
>
> hostPathVolume(mountPath: '/var/run/docker.sock', hostPath:
> '/var/run/docker.sock'),
>
> ]
>
> ) {
>
> node('mypod') {
>
>   stage('Sync') {
>
> parallel Syncfortype1: {
>
> container(name: 'm1', shell: '/bin/bash') {
>
> sync
>
> }
>
> },
>
> Syncfortype2: {
>
> container(name: 'm2', shell: '/bin/bash') {
>
> sync
>
> }
>
> }
>
> }
>
> }
>
> }
>
> I think there may be the way like, but I can't find.
>
> // pre-define
> podTemplate(label: 'm1')
> podTemplate(label: 'm2')
>
> // use it for node
> {
>   stage('sync') {
> parallel A: {
>   node('m1') {
> sync
>   }
> },
> B: {
>   node('m2') {
> sync
>   }
> }
>   }
> }
>
> In Declarative pipeline, samely, I can't find out pre-define multiple
> agents.
>
> Guide document says, define agent in stage.
>
> pipeline {
> agent none
> stages {
> stage('Example Build') {
> agent { docker 'maven:3-alpine' }
> steps {
> echo 'Hello, Maven'
> sh 'mvn --version'
> }
> }
> stage('Example Test') {
> agent { docker 'openjdk:8-jre' }
> steps {
> echo 'Hello, JDK'
> sh 'java -version'
> }
> }
> }
> }
>
>
>
> But I don't know how to use that agent at next stage (one of parallel) ?
>
>
>
>
>
> --
> 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/e33ae964-ee84-4dc5-9f85-60335c265f6a%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/CALHFn6Nv73kE%3D2qa8ZNjSYnq3gCHGz%2BUnwTeLf3YXzKZpsi-YA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Carlos Sanchez
Just remove the 'args' parameter, it would use environments variables

On Tue, May 1, 2018, 20:18 Hung Do  wrote:

> Ah I thought I could just use the JNLP from the openshift-slave-maven-centos7
> directly.
> The end goal is to do the build with the openshift-slave-maven container
> and do some integration tests with an attached mysql container, while at
> the end also do some openshift CLI commands with the maven container. For
> example, I started with the scripted pipelines syntax first.
>
> podTemplate(label: 'maven2', serviceAccount: 'jenkins', cloud: 'openshift'
> , containers: [
>  containerTemplate(name: 'jnlp', image:
> 'docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9',
> alwaysPullImage: true, workingDir: '/tmp', args: '${computer.jnlpmac} ${
> computer.name}', envVars: [
>containerEnvVar(key: 'MAVEN_MIRROR_URL', value: 'xx')
>  ]),
>  containerTemplate(name: 'mysql', image: 'mysql:5.6', alwaysPullImage:
> true, envVars: [
>containerEnvVar(key: 'MYSQL_DATABASE', value: 'xxx'),
>containerEnvVar(key: 'MYSQL_USER', value: 'xxx'),
>containerEnvVar(key: 'MYSQL_PASSWORD', value: 'xxx'),
>containerEnvVar(key: 'MYSQL_RANDOM_ROOT_PASSWORD', value: 'yes')],
> ports: [portMapping(containerPort: 3306)])], volumes: [
>  emptyDirVolume(mountPath: '/var/lib/mysql')
>  ]
>  ) {
>
> node('maven2') {
>stage('checkout') {
>checkout scm
>}
>
> stage('check java') {
>sh "java -version"
>}
>
> This worked out perfectly fine, I thought mapping  it 1:1 to the
> declarative + yaml format would achieve the same result, but that was not
> the case.
>
> Op dinsdag 1 mei 2018 19:55:23 UTC+2 schreef Matthew Ceroni:
>
>> Why even over ride the JNLP container? Just use the default and add
>> another container to the POD with your build tools (then you don't even
>> have to use the YAML format since you won't require any of the extended
>> benefits it provides). Then use the container step to execute in that
>> container.
>>
>> On Tuesday, May 1, 2018 at 5:53:06 AM UTC-7, Hung Do wrote:
>>>
>>> Hi everyone,
>>>
>>> I have a problem with this Jenkinsfile, which doesn't wants to build for
>>> me
>>>
>>> #!/usr/bin/env groovy
>>>
>>> pipeline {
>>>   agent {
>>> kubernetes {
>>>   label 'maven2'
>>>   cloud 'openshift'
>>>   serviceAccount 'jenkins'
>>>   yaml """
>>> apiVersion: v1
>>> kind: Pod
>>> spec:
>>>   containers:
>>>   - name: jnlp
>>> image: 
>>> docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9
>>> imagePullPolicy: Always
>>> workingDir: /tmp
>>> args: ["${computer.jnlpmac} ${computer.name}"]
>>> """
>>> }
>>> }
>>> stages {
>>> stage('Check Java') {
>>> steps {
>>> sh 'java -version'
>>> }
>>> }
>>> }
>>> }
>>>
>>>
>>> With this Jenkinsfile, I get the following error
>>>
>>> [Pipeline] End of Pipeline
>>> groovy.lang.MissingPropertyException: No such property: computer for class: 
>>> groovy.lang.Binding
>>> at groovy.lang.Binding.getVariable(Binding.java:63)
>>> at 
>>> org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:242)
>>> at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288)
>>> at 
>>> org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292)
>>> at 
>>> org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:268)
>>> at 
>>> com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
>>> at 
>>> com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
>>> at WorkflowScript.run(WorkflowScript:18)
>>> at 
>>> org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:56)
>>> at WorkflowScript.run(WorkflowScript:3)
>>> at ___cps.transform___(Native Method)
>>> at 
>>> com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
>>> at 
>>> com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
>>> at 
>>> com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
>>> at sun.reflect.GeneratedMethodAccessor425.invoke(Unknown Source)
>>> at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>> at java.lang.reflect.Method.invoke(Method.java:498)
>>> at 
>>> com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
>>> at 
>>> 

Re: kubernets plugin jnlp4

2018-04-27 Thread Carlos Sanchez
The exceptions may be irrelevant, what errors do you get in the build log?

On Fri, Apr 27, 2018, 04:25 Edward Bond <celpa.f...@gmail.com> wrote:

> Carlos,
>
> Jenkins: Jenkins ver. 2.107.2 <https://jenkins.io/>
> kubernetes plugin: 1.6.0
> Master log file: https://pastebin.com/SBs1iTpy
> Using jnlp-slave:3.10-1
> Kube svc
> >
> NAME  CLUSTER-IP   EXTERNAL-IP
>  PORT(S)  AGE
> jenkins-discovery 5/TCP195d
> jenkins-ui 80/TCP
> 195d
>
> > Top part of docker file
> FROM jenkins/jnlp-slave:3.10-1
> USER root
>
> >
> def runDefault(closure){
>   podTemplate(label: 'default-pod',
>   containers:
>   [
> containerTemplate(name: 'jnlp', image: 'build-agent:jnlp4',
> command: "jenkins-slave",
>resourceRequestCpu: '450m',
>resourceLimitCpu: '850m',
>resourceRequestMemory: '3400Mi',
>resourceLimitMemory: '5608Mi',
> args: '${computer.jnlpmac} ${computer.name}'),
> containerTemplate(name: 'postgres', image: 'postgres:9.6.2'),
> containerTemplate(name: 'elastic', image: '
> docker.elastic.co/elasticsearch/elasticsearch:6.2.3'),
> containerTemplate(name: 'redis', image: 'redis:3.2.10')
>   ],
>   volumes: [
>   hostPathVolume(hostPath: '/var/run/docker.sock', mountPath:
> '/var/run/docker.sock'),
>   hostPathVolume(hostPath: '/usr/bin/docker', mountPath:
> '/usr/bin/docker')
>   ]
>   ) {
> closure()
>   }
> }
>
> I don’t know the fullness of what all the connection issues mean so I
> don’t know what to do to fix it.
>
> The k8s nodes are v1.6.7 running on kops in aws.
>
>
> Any ideas why I am getting:
>
>1. java.nio.channels.ClosedChannelException
>2. at
>
> org.jenkinsci.remoting.protocol.impl.ChannelApplicationLayer.onReadClosed(ChannelApplicationLayer.java:208)
>
>
>1. WARNING: IOHub#1:
>Worker[channel:java.nio.channels.SocketChannel[connected local=/
>100.96.3.136:5 remote=100.96.2.194/100.96.2.194:49506]] /
>Computer.threadPoolForRemoting [#248] for jenkins-slave-z19q3-vpgcb
>terminated
>2. java.nio.channels.ClosedChannelException
>3. at
>
> org.jenkinsci.remoting.protocol.NetworkLayer.onRecvClosed(NetworkLayer.java:154)
>4. at
>
> org.jenkinsci.remoting.protocol.impl.NIONetworkLayer.ready(NIONetworkLayer.java:179)
>5. at
>org.jenkinsci.remoting.protocol.IOHub$OnReady.run(IOHub.java:789)
>6. at
>
> jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
>
>
>1. at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>2. at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>3. at java.lang.Thread.run(Thread.java:748)
>
>
>
>
>
> Thanks again,
>
> - Ed
>
>
>
> On Apr 24, 2018, at 10:44 AM, Edward Bond <celpa.f...@gmail.com> wrote:
>
> Carlos,
>
> Was this a known issue before? I will snapshot the drive and try the
> upgrade to the latest of everything next week.
>
> Maybe it is a kops / aws issue.
>
> Thanks!
>
> - Ed
>
> On Apr 24, 2018, at 4:54 AM, Carlos Sanchez <car...@apache.org> wrote:
>
> All the plugin builds are running in GKE and I haven't experienced any
> failed jobs for a while. Jenkins weekly and k8s latest release with default
> jnlp image
>
> On Mon, Apr 23, 2018 at 9:58 PM, Edward Bond <celpa.f...@gmail.com> wrote:
>
>> Hello All,
>>
>> I am using Jenkins LTS, 2.107.2. with kubernetes plugin: 1.1.3, jnlp-2,
>> using kops inside aws.
>>
>> I have to have jnlp2-connect enabled because using jnlp4 has a higher
>> failure rate.
>>
>> Currently I am getting abount a 80% success rate with my current setup.
>> When I upgraded ( 2 months ago ) to latest master and latest k8s plugin I
>> was having about a 15% success rate of builds.
>>
>> WARNING: Failed to send back a reply to the request
>> hudson.remoting.Request$2@725700df
>> hudson.remoting.ChannelClosedException: Channel
>> "hudson.remoting.Channel@7083e923:Channel to /100.96.3.149": channel is
>> already closed
>> at hudson.remoting.Channel.send(Channel.java:715)
>> at hudson.remoting.Request$2.run(Request.java:377)
>> at
>> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
>> at
>> org.jenkinsci.remoting.Call

Re: kubernets plugin jnlp4

2018-04-24 Thread Carlos Sanchez
All the plugin builds are running in GKE and I haven't experienced any
failed jobs for a while. Jenkins weekly and k8s latest release with default
jnlp image

On Mon, Apr 23, 2018 at 9:58 PM, Edward Bond  wrote:

> Hello All,
>
> I am using Jenkins LTS, 2.107.2. with kubernetes plugin: 1.1.3, jnlp-2,
> using kops inside aws.
>
> I have to have jnlp2-connect enabled because using jnlp4 has a higher
> failure rate.
>
> Currently I am getting abount a 80% success rate with my current setup.
> When I upgraded ( 2 months ago ) to latest master and latest k8s plugin I
> was having about a 15% success rate of builds.
>
> WARNING: Failed to send back a reply to the request
> hudson.remoting.Request$2@725700df
> hudson.remoting.ChannelClosedException: Channel 
> "hudson.remoting.Channel@7083e923:Channel
> to /100.96.3.149": channel is already closed
> at hudson.remoting.Channel.send(Channel.java:715)
> at hudson.remoting.Request$2.run(Request.java:377)
> at hudson.remoting.InterceptingExecutorService$1.call(
> InterceptingExecutorService.java:72)
> at org.jenkinsci.remoting.CallableDecorator.call(
> CallableDecorator.java:19)
> at hudson.remoting.CallableDecoratorList$1.call(
> CallableDecoratorList.java:21)
> at jenkins.util.ContextResettingExecutorService$2.call(
> ContextResettingExecutorService.java:46)
> 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)
> Caused by: java.io.IOException
> at hudson.remoting.Channel.close(Channel.java:1443)
> at hudson.remoting.Channel.close(Channel.java:1399)
> at hudson.slaves.SlaveComputer.closeChannel(SlaveComputer.java:746)
> at hudson.slaves.SlaveComputer.access$800(SlaveComputer.java:99)
> at hudson.slaves.SlaveComputer$3.run(SlaveComputer.java:664)
> at jenkins.util.ContextResettingExecutorService$1.run(
> ContextResettingExecutorService.java:28)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> ... 4 more
>
> These are the type of errors I get.
>
> Anyone have a list of versions that work for them and jnlp4?
>
> It would be awesome to have a known good config of:
>
>1. Master docker image version
>2. K8s plugin version
>3. jnlp pod agent base image version
>
>
> Thanks in advance.
>
> --
> 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/9c07626f-a538-4e9a-9d3b-0cc8c3948355%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/CALHFn6Mp2ZVbEFhrX72a-0-a-ut83hDDNC%3DJRQn4JWD2Ey0vVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Kubernetes agents fail handshake with master.

2018-04-09 Thread Carlos Sanchez
Are you running jenkins with SSL enabled ? or are you running jenkins
non-ssl and then enabling ssl at ingress level
The plugin will connect internally to the cluster so typically no SSL url
is used



On Sun, Apr 8, 2018 at 10:37 PM, Ryan Timoney 
wrote:

> I've got Jenkins running on an instance on Google Compute Engine. I've got
> a Kubernetes cluster set up on GKE to run agents on. I followed the steps
> here:  https://cloud.google.com/solutions/configuring-
> jenkins-kubernetes-engin
>  The
> master successfully creates pods, but the SSL handshake always fails with
> this error:
>
> Error in provisioning; agent=KubernetesSlave name: jenkins-t4lpw, 
> template=PodTemplate{inheritFrom='', name='jenkins', namespace='', 
> instanceCap=5, label='debian-8', nodeSelector='', nodeUsageMode=NORMAL, 
> workspaceVolume=org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume@22c413cb,
>  containers=[ContainerTemplate{name='build-agent', 
> image='jenkins/jnlp-slave', workingDir='/home/jenkins', command='/bin/sh -c', 
> args='cat', ttyEnabled=true, resourceRequestCpu='', resourceRequestMemory='', 
> resourceLimitCpu='', resourceLimitMemory='', 
> livenessProbe=org.csanchez.jenkins.plugins.kubernetes.ContainerLivenessProbe@76480942}]}.
>  Container jnlp exited with error 255. Logs:   at 
> sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
> at 
> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1514)
> at 
> sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
> at sun.security.ssl.Handshaker.process_record(Handshaker.java:961)
> at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
> at 
> sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
> at 
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
> at 
> sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
> at 
> sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
> at 
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
> at 
> sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:162)
> at 
> org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:189)
> ... 2 more
> Caused by: sun.security.validator.ValidatorException: PKIX path building 
> failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to 
> find valid certification path to requested target
> at 
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:397)
> at 
> sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:302)
> at sun.security.validator.Validator.validate(Validator.java:260)
> at 
> sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
> at 
> sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
> at 
> sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
> at 
> sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
> ... 13 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable 
> to find valid certification path to requested target
> at 
> sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
> at 
> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
> at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
> at 
> sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:392)
> ... 19 more
>
>
> I know the SSL cert used by my master is valid, so I don't know what the
> issue is. I've tried using a local IP and providing a cert signed by my own
> CA, then making a new image off of gcr.io/cloud-solutions-
> images/jenkins-k8s-slave:v4 that imports the CA into the jave keystore,
> but I still get the same error.
>
> Is there any way to pass the  --httpsKeyStore argument to Jenkins agents
> that are run on GKE? If that isn't the problem, where should I look in my
> config?
>
> --
> 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/6c9bc8b9-731b-4fcb-8eb1-c0e8f4973b52%40googlegroups.
> com
> 

Re: Example of a working pod with the kubernetes-ci plugin

2018-03-20 Thread Carlos Sanchez
Yes it totally does. You need to open the ports from agent to master


On Tue, Mar 20, 2018, 21:19 Fadi Al-Farah  wrote:

> I'm also interested in this.. Does this plugin support having a Jenkins
> master running somewhere else and the slaves in the k8s cluster?
>
>
> On Thursday, December 28, 2017 at 4:17:56 PM UTC-5, Vamsi krishna wrote:
>>
>> @carlos
>> i checked the logs but there is nothing showing in the logs jenkins
>> is running outside of the cluster.. so i cant use the jenkins if i run
>> outside the cluster.
>>
>> On Monday, November 21, 2016 at 12:43:08 AM UTC-8, Sébastien Douche wrote:
>>>
>>> Hi folks,
>>> I try with the kubernetes-ci to create a pod with a container to do some
>>> work (get source code, compile it, etc) and a jnlp container (only used
>>> to connect to the Jenkins server). The goal is to avoid the adding of
>>> the jnlp binary into all my containers. So I tried this:
>>>
>>> 
>>> apiVersion: "v1"
>>> kind: "Pod"
>>> metadata:
>>>   name: "k8s-slave"
>>>   labels:
>>> name: "k8s-slave"
>>> spec:
>>>   containers:
>>>   - name: "jenkins-slave"
>>> image: "jenkinsci/jnlp-slave"
>>> volumeMounts:
>>> - mountPath: /home/jenkins
>>>   name: workspace-volume
>>> env:
>>> - name: "JENKINS_URL"
>>>   value: "https://XXX;
>>>   - name: "golang"
>>> image: "golang:1.6.3-alpine"
>>> volumeMounts:
>>> - mountPath: /home/jenkins
>>>   name: workspace-volume
>>>   volumes:
>>> - emptyDir: {}
>>>   name: workspace-volume
>>> 
>>>
>>> And a trivial job which try to access on the golang container:
>>>
>>> 
>>> git clone https://github.com/hashicorp/terraform.git
>>> mkdir -p /go/src/github.com/hashicorp
>>> ln -s `pwd` /go/src/github.com/hashicorp/terraform
>>> cd /go/src/github.com/hashicorp/terraform && make core-dev
>>> 
>>>
>>> It doesn't work 'cause the job have access on the jnlp fs and not the
>>> golang one. What is missing to access on the golang container?
>>>
>>>
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> Sébastien Douche 
>>> Twitter: @sdouche
>>> http://douche.name
>>>
>> --
> 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/khpG2-6NBNI/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/54962d38-41b7-40f3-ad2e-e01576a21875%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/CALHFn6PKPQer_LrnZwe1o6khV1K-4i2FnKkEgWJhEHnPnPPWvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes plugin cloud not found error

2018-03-15 Thread Carlos Sanchez
You need to use "add cloud" in jenkins configuration

On Wed, Mar 14, 2018, 06:38 Prasanna Ranganathan 
wrote:

> Hi,
>
> I was trying the kubernetes plugin. I installed and configured the
> kubernetes setup connection test was successfull.
> and tried the below code.
>
> def label = "mypod-${UUID.randomUUID().toString()}"echo "Label:" +
> labelpodTemplate(label: label) { node(label) { stage('Run shell') { sh 'echo
> hello world' } }}
>
> But still, i do get this error.
>
> [Pipeline] podTemplate[Pipeline] // podTemplate[Pipeline] End of 
> PipelineERROR: Cloud does not exist: kubernetes
> Finished: FAILURE
>
>
>
> even if i give cloud variable as something still it says cloud does not
> exist
>
> --
> 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/998c5cbc-3de7-4131-b77f-fdd949a71477%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/CALHFn6P2X-rofsHdOWLj9zYXSO5Zg1oUMkP9JTCuCpLu8dCciA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes and docker syntax for jenkins declarative pipeline

2018-03-05 Thread Carlos Sanchez
You would probably be interested in
https://issues.jenkins-ci.org/browse/JENKINS-48050

On Mon, Mar 5, 2018 at 1:08 PM, Tristan FAURE 
wrote:

> Hello all,
>
> we are currently experiencing docker capabilities in jenkins with
> Jenkinsfile and declarative pipelines using this instruction :
> agent {
>  docker { image 'node:7-alpine' }
> }
>
> I try to follow the initiatives around kubernetes and it seems very
> interesting but what I can see from the github (
> https://github.com/jenkinsci/kubernetes-plugin) is that the syntax
> changed to declare the desired POD :
>
> podTemplate(label: label) {
>   node(label) {
> stage('Run shell') {
>   container('mycontainer') {
> sh 'echo hello world'
>   }
> }
>   }
> }
>
> Can we imagine the future a compability between the first syntax (only the 
> image name) and a deployment on Kubernetes ?
>
> We will not deploy yet a kubernetes cluster and I'm concerned about job 
> compatibility switching from a docker only environment to a kubernetes one.
>
> Regards
>
> 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/be4fda12-946d-4277-9dc0-e60ee1f1730a%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/CALHFn6M%3D7jUz3sNw%3Dh008eB0eG8s4W-5LmMohRNabKngbZS3ZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Connecting static node within 'jenkins-kubernetes-plugin' dynamic environment.

2018-03-05 Thread Carlos Sanchez
yes, you can do that, using the tunnel parameter of the jnlp-slave jar
If you want to run an external agent on docker use
JENKINS_TUNNEL=your_node_ip:your_node_port for instance
https://github.com/jenkinsci/docker-jnlp-slave#running

On Mon, Mar 5, 2018 at 11:34 AM, WANG, YAN-HONG 
wrote:

> Hello,
>
> I use jenkins-kubernetes-plugin to run Jenkins in Kubernetes cluster.
> So far that works perfectly.
> All the nodes are automatically generated and destroyed in right moment of
> pipeline.
>
> But, is it possible to connect external *static node *within Jenkins of
> Kubernetes cluster ?
>
> By definition of NodePort, the Kubernetes master only allocates a port
> from a flag-configured range: *3-32767*.
> Suppose I need to expose *8080 *and *5 *with *30808 *and *30500 *
> 'NodePort'.
>
> I tried to change the agent_port to
> *30500.*
> ​But, that still doesn't work...
>
> Is there any someone have some similar condition?
>
> Best regards,
> Hong
>
> --
> 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/CADLWyO3EOf-OeXo3jZtwgznqyzhA%
> 2BqZVkpjZT5ModrcXJYLQkA%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/CALHFn6O7_SKgbc7qeMQ4q%3DfXXcA%3DGA0t9%2B%2B5HGWoEKutgTfqRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin share workspace

2018-02-27 Thread Carlos Sanchez
You should be able to mount the workspace as an external volume using
persistentVolumeClaim in your podTemplate

On Mon, Feb 26, 2018 at 11:02 PM, Matthew Ceroni 
wrote:

> Is it possible, much like with the docker agent and reuseNode option, to
> share a work space between multiple kubernetes pods?
>
> My use case that I am trying to solve it to utilize the lock/milestone
> functionality to promote artifacts through environments (test, staging,
> prod). The problem is if I use a global agent at the top of my pipeline,
> that POD will stick around until the end user finally proceeds or aborts
> the promotion. I don't really want that as it uses up resources. If I use a
> stage specific agent then I have the problem that the workspace gets
> re-initialized each time.
>
> Thanks in advance.
>
> --
> 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/d6780c76-cc0c-4f60-90c5-448be26b7d61%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/CALHFn6NWHHJpcedePetffpgjui48QHp9sMYRMAVTh-uj%2BS5_wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin 1.2 Agents unable to establish connection to master, but log they can

2018-02-22 Thread Carlos Sanchez
OOMKilled has nothing to do with the host resources, but the process in the
container using more memory than available.
Try increasing the memory limits and read
https://blog.csanchez.org/2017/05/31/running-a-jvm-in-a-container-without-getting-killed/

On Thu, Feb 22, 2018 at 10:19 AM,  wrote:

> Disk space and memory are all at an extremely low utilization for all of
> my hosts. So it's not real resource exhaustion. I'm thinking timeline wise
> it seems that OOMkilled state is possibly a result of kubernetes
> terminating the pod due to disconnection.
>
>
> INFO: Excess workload after pending Spot instances: 1
> Feb 22, 2018 9:05:10 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud
> provision
> INFO: Template: Kubernetes Pod Template
> Feb 22, 2018 9:05:10 AM okhttp3.internal.platform.Platform log
> INFO: ALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot
> class path?
> Feb 22, 2018 9:05:10 AM hudson.slaves.NodeProvisioner$StandardStrategyImpl
> apply
> INFO: Started provisioning Kubernetes Pod Template from kubernetes with 1
> executors. Remaining excess workload: 0
> Feb 22, 2018 9:05:20 AM hudson.slaves.NodeProvisioner$2 run
> INFO: Kubernetes Pod Template provisioning successfully completed. We have
> now 2 computer(s)
> Feb 22, 2018 9:05:20 AM okhttp3.internal.platform.Platform log
> INFO: ALPN callback dropped: HTTP/2 is disabled. Is alpn-boot on the boot
> class path?
> Feb 22, 2018 9:05:20 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Created Pod: jnlp-t2c36 in namespace jenkins-test
> Feb 22, 2018 9:05:20 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (0/100): jnlp-t2c36
> Feb 22, 2018 9:05:26 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (1/100): jnlp-t2c36
> Feb 22, 2018 9:05:32 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (2/100): jnlp-t2c36
> Feb 22, 2018 9:05:38 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (3/100): jnlp-t2c36
> Feb 22, 2018 9:05:44 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (4/100): jnlp-t2c36
> Feb 22, 2018 9:05:47 AM hudson.model.Descriptor verifyNewInstance
> WARNING: Father of ContainerEnvVar [getValue()=http://jenkins-
> test-jenkins:8080, getKey()=JENKINS_URL] and its getDescriptor() points
> to two different instances. Probably malplaced @Extension. See
> http://hudson.361315.n4.nabble.com/Help-Hint-needed-
> Post-build-action-doesn-t-stay-activated-td2308833.html
> Feb 22, 2018 9:05:50 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (5/100): jnlp-t2c36
> Feb 22, 2018 9:05:56 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (6/100): jnlp-t2c36
> Feb 22, 2018 9:06:02 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (7/100): jnlp-t2c36
> Feb 22, 2018 9:06:08 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (8/100): jnlp-t2c36
> Feb 22, 2018 9:06:14 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (9/100): jnlp-t2c36
> Feb 22, 2018 9:06:20 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (10/100): jnlp-t2c36
> Feb 22, 2018 9:06:26 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (11/100): jnlp-t2c36
> Feb 22, 2018 9:06:32 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (12/100): jnlp-t2c36
> Feb 22, 2018 9:06:38 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (13/100): jnlp-t2c36
> Feb 22, 2018 9:06:44 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (14/100): jnlp-t2c36
> Feb 22, 2018 9:06:50 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (15/100): jnlp-t2c36
> Feb 22, 2018 9:06:56 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (16/100): jnlp-t2c36
> Feb 22, 2018 9:07:02 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (17/100): jnlp-t2c36
> Feb 22, 2018 9:07:08 AM 
> org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher
> launch
> INFO: Waiting for Pod to be scheduled (18/100): jnlp-t2c36
> Feb 22, 2018 

Re: Kubernetes Plugin 1.2 Agents unable to establish connection to master, but log they can

2018-02-22 Thread Carlos Sanchez
That log suggests that the slave is not "online" for jenkins. If you go to
the jenkins nodes page under /computer/ what do you see? maybe the slave is
offline for some reason, lack of space or something

On Wed, Feb 21, 2018 at 9:25 PM,  wrote:

> I've downgraded to the 1.2 version of the plugin and gone through the
> debug steps listed here https://github.com/jenkinsci/kubernetes-plugin
>
> No luck.
>
> --
> 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/b17a41a6-25f2-4aff-906d-b53879d33f0e%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/CALHFn6MJrNTgpkJwXLEMT38F-ULZm%2B9Z5QrXSUB2GppU-EQZqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins slave offline

2018-02-13 Thread Carlos Sanchez
> Caused by: javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alternative names
matching IP address MY_JENKINS_IP found

If you don't use valid ssl certificates in the jenkins master you'll need
to configure Java in the jnlp agent docker, it has nothing to do with
kubernetes.

https://stackoverflow.com/questions/8443081/how-are-ssl-certificate-server-names-resolved-can-i-add-alternative-names-using?lq=1

unless you are hitting https://issues.jenkins-ci.org/browse/JENKINS-43527



On Tue, Feb 13, 2018 at 8:33 AM, Nick Li  wrote:

> jenkins master is running outside of k8s cluster,
> from the log, looks like slave created in k8s cluster can't connect to
> jenkins master.
>
> What do I need to do?
>
>
> On Tuesday, February 13, 2018 at 3:08:46 PM UTC+8, Nick Li wrote:
>>
>> I running jenkins master outside or k8s cluster,
>> After running the job, I can the pod is created and running, then turned
>> into terminated very soon,
>> Looks ing slave created in k8s cluster can't connect to jenkins master.
>>
>> from JNLP container log I can see
>>
>> Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to
>> alter the behavior
>> Warning: SECRET is defined twice in command-line arguments and the
>> environment variable
>> Warning: AGENT_NAME is defined twice in command-line arguments and the
>> environment variable
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main createEngine
>> INFO: Setting up agent: jenkins-slave-n58w4-bdvl7
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener
>> init
>> INFO: Jenkins agent is running in headless mode.
>> Feb 13, 2018 7:02:03 AM hudson.remoting.Engine startEngine
>> WARNING: No Working Directory. Using the legacy JAR Cache location:
>> /home/jenkins/.jenkins/cache/jars
>> Feb 13, 2018 7:02:03 AM hudson.remoting.jnlp.Main$CuiListener status
>> INFO: Locating server among [https://MY_JENKINS_IP/]
>> Feb 13, 2018 7:02:04 AM hudson.remoting.jnlp.Main$CuiListener error
>> SEVERE: Failed to connect to https://MY_JENKINS_IP/tcpSlaveAgentListener/:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> java.io.IOException: Failed to connect to 
>> https://MY_JENKINS_IP/tcpSlaveAgentListener/:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.reso
>> lve(JnlpAgentEndpointResolver.java:199)
>> at hudson.remoting.Engine.innerRun(Engine.java:518)
>> at hudson.remoting.Engine.run(Engine.java:469)
>> Caused by: javax.net.ssl.SSLHandshakeException:
>> java.security.cert.CertificateException: No subject alternative names
>> matching IP address MY_JENKINS_IP found
>> at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
>> at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959)
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
>> at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
>> at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHa
>> ndshaker.java:1514)
>> at sun.security.ssl.ClientHandshaker.processMessage(ClientHands
>> haker.java:216)
>> at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1026)
>>
>> On Friday, February 9, 2018 at 4:23:48 PM UTC+8, Nick Li wrote:
>>>
>>> jenkins-slave is offline (suspend) from jenkins webpage.
>>>
>>> My environment:
>>> I have jenkins running on a debian server, created a k8s cluster in gcp.
>>> installed kubernetes-plugin, configed k8s in jenkins cloud section,(using
>>> admin/k8s password.),
>>>
>>> Then created a test pipeline job using the following script
>>> ```
>>> podTemplate(label: 'pod-golang',
>>> containers: [
>>> containerTemplate(
>>> name: 'golang',
>>> image: 'golang',
>>> ttyEnabled: true,
>>> command: 'cat'
>>> )
>>> ]
>>> ) {
>>> node ('pod-golang') {
>>>
>>> stage 'Switch to Utility Container'
>>> container('golang') {
>>>
>>>   sh ("go version")
>>>
>>> }
>>> }
>>> }
>>> ```
>>> from `kubectl get pods` I can see the pod is created, but on jenkins
>>> webpage, jenkins-slave is alwasy showing offline
>>> Any ideas
>>>
>>> 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/e58f2594-cec3-46df-9d51-f96c04493d0b%40googlegroups.
> com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to 

Re: jenkins slave offline

2018-02-09 Thread Carlos Sanchez
that means jenkins can't talk to my-kubernetes-cluster-ip and it wouldn't
possibly launch a pod

On Fri, Feb 9, 2018 at 11:17 AM, Nick Li <nicklee...@gmail.com> wrote:

> Hi Carlos,
>
> In my jenkins kubernetes cloud config section. I have a connection error
> now.
> I confirmed the admin/k8s-password.
>
> Error testing connection http://my-kubernetes-cluster-ip: 
> java.net.SocketTimeoutException:
> connect timed out
>
> Thanks
>
> On Friday, February 9, 2018 at 5:04:38 PM UTC+8, Carlos Sanchez wrote:
>>
>> you can check the steps in https://github.com/jenkinsc
>> i/kubernetes-plugin/#debugging to debug
>>
>> On Fri, Feb 9, 2018 at 7:09 AM, Nick Li <nickl...@gmail.com> wrote:
>>
>>> jenkins-slave is offline (suspend) from jenkins webpage.
>>>
>>> My environment:
>>> I have jenkins running on a debian server, created a k8s cluster in gcp.
>>> installed kubernetes-plugin, configed k8s in jenkins cloud section,(using
>>> admin/k8s password.),
>>>
>>> Then created a test pipeline job using the following script
>>> ```
>>> podTemplate(label: 'pod-golang',
>>> containers: [
>>> containerTemplate(
>>> name: 'golang',
>>> image: 'golang',
>>> ttyEnabled: true,
>>> command: 'cat'
>>> )
>>> ]
>>> ) {
>>> node ('pod-golang') {
>>>
>>> stage 'Switch to Utility Container'
>>> container('golang') {
>>>
>>>   sh ("go version")
>>>
>>> }
>>> }
>>> }
>>> ```
>>> from `kubectl get pods` I can see the pod is created, but on jenkins
>>> webpage, jenkins-slave is alwasy showing offline
>>> Any ideas
>>>
>>> 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/ms
>>> gid/jenkinsci-users/b2350dfa-07fd-4935-9d49-42c5d9d35d5f%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/b2350dfa-07fd-4935-9d49-42c5d9d35d5f%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/60b1659d-68fd-4385-ab2f-c32f3d2a71d8%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/60b1659d-68fd-4385-ab2f-c32f3d2a71d8%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/CALHFn6PV-RkEgwSxJ0ZN0OshL%2Bf1Q2Sxsie3DXCR8zKG2Z9LhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: jenkins slave offline

2018-02-09 Thread Carlos Sanchez
you can check the steps in
https://github.com/jenkinsci/kubernetes-plugin/#debugging to debug

On Fri, Feb 9, 2018 at 7:09 AM, Nick Li  wrote:

> jenkins-slave is offline (suspend) from jenkins webpage.
>
> My environment:
> I have jenkins running on a debian server, created a k8s cluster in gcp.
> installed kubernetes-plugin, configed k8s in jenkins cloud section,(using
> admin/k8s password.),
>
> Then created a test pipeline job using the following script
> ```
> podTemplate(label: 'pod-golang',
> containers: [
> containerTemplate(
> name: 'golang',
> image: 'golang',
> ttyEnabled: true,
> command: 'cat'
> )
> ]
> ) {
> node ('pod-golang') {
>
> stage 'Switch to Utility Container'
> container('golang') {
>
>   sh ("go version")
>
> }
> }
> }
> ```
> from `kubectl get pods` I can see the pod is created, but on jenkins
> webpage, jenkins-slave is alwasy showing offline
> Any ideas
>
> 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/b2350dfa-07fd-4935-9d49-42c5d9d35d5f%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/CALHFn6M8kTg7imkj%3DzN%3D_tKrwhQUPGbFdCZrhHHJtun3_L25%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No credentials/secrets pulled from master into PodTemplate/ContainerTemplate by Jenkins Kubernetes Plugin during pipeline execution?

2018-02-08 Thread Carlos Sanchez
"timed out waiting for server" means the pod can't connect to your svn
server

On Thu, Feb 8, 2018 at 1:49 AM, Dan Leshc <dle...@gmail.com> wrote:

> Hi,
>
> i have v1.2 of Kubernetes plugin, but checkout still fails -- apparently
> due to not finding credentials -- when i point at any node other than the
> master. any pointers as to what i am doing wrong or how to workaround the
> issue?
>
> thanks,
> dan
>
> pipeline:
>
> podTemplate(
> label: 'svntest',
> containers: [containerTemplate(name: 'jnlp', image:
> 'jenkins/jnlp-slave:alpine', args: '${computer.jnlpmac} ${computer.name
> }')],
> nodeSelector: 'kubernetes.io/hostname=cluster-member.some-company.com
> ')
> {
> node('svntest')
> {
> checkout([$class: 'SubversionSCM', additionalCredentials:
> [[credentialsId: 'svnlogin', realm: '<https://svn.some-company.com:443>
> Some-Company ActiveDirectory ID']], excludedCommitMessages: '',
> excludedRegions: '', excludedRevprop: '', excludedUsers: '',
> filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '',
> locations: [[credentialsId: 'svnlogin', depthOption: 'immediates',
> ignoreExternalsOption: true, local: '.', remote: '
> https://svn.some-company.com/svn/repo']], quietOperation: true,
> workspaceUpdater: [$class: 'UpdateUpdater']])
> }
> }
>
>  log:
>
> Started by user anonymous
> Running in Durability level: PERFORMANCE_OPTIMIZED
> [Pipeline] podTemplate
> [Pipeline] {
> [Pipeline] node
> Still waiting to schedule task
> jenkins-slave-19lx3-6p5t0 is offline
> Running on jenkins-slave-0ztg1-5w07r in /home/jenkins/workspace/scmtest
> [Pipeline] {
> [Pipeline] checkout
> Checking out a fresh workspace because /home/jenkins/workspace/scmtest
> doesn't exist
> Cleaning local Directory .
> Checking out https://svn.some-company.com/svn/repo at revision
> '2018-02-08T00:15:43.521 +' --quiet
> ERROR: Failed to check out https://svn.some-company.com/svn/repo
> org.tmatesoft.svn.core.SVNException: svn: E175002: timed out waiting for
> server
> svn: E175002: OPTIONS request failed on '/svn/repo'
> at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.
> error(SVNErrorManager.java:112)
>
> on master -- where checkout works -- checkout lines look like:
>
> Checking out https://svn.some-company.com/svn/repo at revision
> '2018-02-08T00:15:43.521 +' --quiet
> Found credentials some-user/** in realm ‘<https://svn.some-company.
> com:443> Some-Company ActiveDirectory ID’
>
>
> On Sunday, September 3, 2017 at 2:56:44 AM UTC-7, Carlos Sanchez wrote:
>>
>> To pull images from private registries you need the imagePullSecrets
>> option (not yet released for pipeline, will be in 1.0)
>> For credentials you would need to do something with them, ie. put them in
>> an environment variable and then use it in the containers. This has also
>> been improved/fixed for 1.0
>>
>>
>> On Sun, Sep 3, 2017 at 10:26 AM, Vedran Lerenc <vle...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> Setting the scene:
>>> I have set up a multi-node Kubernetes cluster [1] and deployed the
>>> Jenkins Helm Chart [2] with the Jenkins Kubernetes plugin [3]. We run
>>> (company-)internally an Enterprise GitHub installation and we have multiple
>>> private and public repos. The builds are implemented using non-declarative
>>> Jenkins pipelines [4] (many features are missing in the plugin for
>>> declarative pipelines [5]). The builds don't run on the Jenkins master, but
>>> every job run consumes its own pod for obvious reasons (maximum scale-out
>>> and total isolation/no side effects) via podTemplates/containerTemplates
>>> [6].
>>>
>>> The problem/question:
>>> I found no way or description how to fetch from private repos or, more
>>> generally spoken, I found no way to pull any credentials/secrets from the
>>> Jenkins master (where I like to maintain them centrally) into the
>>> pods/containers that the plugin creates for my job runs, i.e. I miss in
>>> those pods/containers e.g. the credentials/secrets to pull from a private
>>> repo. How can I make those available in the dynamically spawned
>>> pods/containers? Is that even possible?
>>>
>>> Some additional information:
>>> On my Jenkins master I can perfectly fetch from private repos, have
>>> access to everything and all is fine. It's only lately that I tried to use
>>> the Kubernetes plugin and get more out of my cluster. Also, I `kubectl
>>> exec`'d into the JNLP slave container (and its siblings based on my

Re: Kubernetes-Plugin BadRequest container name must be specified

2018-01-31 Thread Carlos Sanchez
On Mon, Jan 22, 2018 at 11:27 PM, Chris Denneen <cdenn...@gmail.com> wrote:

> 1. I was using the external name rather than the internal (cluster.local)
> DNS name in the Kubernetes Cloud Configuration in Jenkins
> 2. Even when I switched it appears it's because the port is necessary (
> http://jenkins.jenkins.svc.cluster.local:443) which I found in open issue
> (https://issues.jenkins-ci.org/browse/JENKINS-48368)
>

The port depends on how you expose the jenkins service. You setup the
jenkins service as non ssl in port 443 ? that's wrong


> 3. If Jenkins wasn't running within a Kubernetes cluster but you wanted to
> leverage the slaves/agents to be run on one then I'm guessing a slave
> secret would need to be made available.
>

That depends on how you want to set it up, there are many options and
different authentication providers


>
> Can documentation for #2 and #3 be made/updated for future?
>
> Thanks
>
> On Monday, January 22, 2018 at 3:01:41 PM UTC-5, Chris Denneen wrote:
>>
>> I've installed latest LTS of jenkins and installed latest
>> kubernetes-plugin.
>>
>> I've created 2 pipeline jobs to test:
>>
>> pod-golang from here (https://kumorilabs.com/blog/k
>> 8s-6-integrating-jenkins-kubernetes/)
>> and one from Carlos Sanchez blog here (https://blog.csanchez.org/201
>> 6/10/25/jenkins-kubernetes-plugin-0-9-released/)
>>
>> Both pods create with the following logs and loop:
>>
>> work/capdev-kubernetes » kubectl logs jenkins-slave-1kl4v-flv53
>> Error from server (BadRequest): a container name must be specified for
>> pod jenkins-slave-1kl4v-flv53, choose one of: [golang jnlp]
>>
>> work/capdev-kubernetes » kubectl logs jenkins-slave-pwcwz-2k20s
>> Error from server (BadRequest): a container name must be specified for
>> pod jenkins-slave-pwcwz-2k20s, choose one of: [maven golang jnlp]
>>
>>
>> Is there something else that needs to be done in order to get these to
>> work?
>>
> --
> 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/01214aa2-964c-4819-99e8-75e8c712b9b1%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/01214aa2-964c-4819-99e8-75e8c712b9b1%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/CALHFn6NUQPKrVRkcVDducgRAc-f6-r9h7Q2YVJfuGQTKP5J7Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: A recent change (or bug) in either Docker and/or Jenkins is breaking most tutorials in the Jenkins User Documentation.

2018-01-30 Thread Carlos Sanchez
This is biting a lot of users and reporting it as a bug
https://github.com/jenkinsci/docker/issues/626



On Tue, Jan 30, 2018 at 2:27 AM,  wrote:

> Hi All,
>
> I've updated all the plug-in for jenkins but I still can't get the
> tutorial to work. I'm getting this error when it runs
>
> [simple-java-maven-app] Running shell script
> sh: can't create /var/jenkins_home/workspace/simple-java-maven-app@tmp/
> durable-3b228035/jenkins-log.txt: nonexistent directory
> sh: can't create /var/jenkins_home/workspace/simple-java-maven-app@tmp/
> durable-3b228035/jenkins-result.txt: nonexistent directory
> script returned exit code -2
>
> I've even tried reinstall everything, but I'm still getting this error.
>
> Is it still an issue or am I the only one having this problem
>
> I'm using a MacBook Pro on High Sierra.
>
> Thanks.
>
> On Wednesday, January 24, 2018 at 11:12:58 AM UTC+8, Giles Gaskell wrote:
>>
>> Hi everyone,
>>
>> Just a quick follow-up ...
>>
>> It's possible that this issue may have resulted from recent changes in
>> Docker behavior (i.e. in recent Docker versions) which were no longer being
>> handled correctly by the Jenkins Docker Pipeline plugin.
>>
>> Once this PR (https://github.com/jenkinsci/docker-workflow-plugin/pull/12
>> 8) is merged and a new version of this plugin released, then these
>> tutorials should start working again (as documented).
>>
>> Cheers,
>> Giles.
>>
>> On Wednesday, January 24, 2018 at 12:10:09 PM UTC+11, Giles Gaskell wrote:
>>>
>>> Thanks so much for all the sleuthing work Damien - you've hit the nail
>>> on the head with this one.
>>>
>>> Cheers,
>>> Giles.
>>>
>>> On 24 January 2018 at 00:43, Damien Duportal 
>>> wrote:
>>>
 This issue is related to the "Docker Pipeline" plugin
 ("docker-workflow") which has an issue when trying to determine if the
 executor (master or agent) is running inside a container.

 See issue/PR #120 of "docker-workflow-plugin", in particular
 https://github.com/jenkinsci/docker-workflow-plugin/pull/120
 #issuecomment-357284756 which is for the standard "docker".

 Here is my work list items to diagnose this:

 * The tutorials are working quite well with some older version of
 Docker (example: 17.09)
 * When the tutorial is not working, wee the build failing, and before
 the error message "shnot found...", we have a difference in the logs:
 it says "Jenkins does not seem to be running inside a container".
   - We can also see the "docker run" commands issued by the
 docker-workflow plugin:
 > BEFORE: "--volumes-from "
 > AFTER: "-v /var/jenkins_home/:/var/jenkins_home/."
 * This log message come from this piece of code on the plugin (v.1.14
 when writing those lines): https://github.com/jen
 kinsci/docker-workflow-plugin/blob/docker-workflow-1.14/src/
 main/java/org/jenkinsci/plugins/docker/workflow/
 WithContainerStep.java#L158-L182
 * As Far as I Understand, The function "getContainerIdIfContainerized()"
 is returning the Optional.absent() String when it is not working, so the
 condition is false.
 * This function is implemented here: https://github.com/jenki
 nsci/docker-workflow-plugin/blob/docker-workflow-1.14/src/
 main/java/org/jenkinsci/plugins/docker/workflow/
 client/DockerClient.java#L311
 * Before diving in the code (and because I really suck at
 reading/writing code), I first checked my cgroup self file to see what it
 looks like (smelling Pattern issue...): https://gist.github
 .com/dduportal/67f965dd935b4fb7d316b798f2a6c2ef
   - While someone with the tutorial working got this:
 https://gist.github.com/dduportal/0ac5e5c76043e95fa0b5ff85c1b0c93e
 * See the diff? "/docker/" vs. "/docker-ce/".
 * Searching the Internet made it easy to catch https://github.com/jenki
 nsci/docker-workflow-plugin/pull/120
 
 .

 => The constant used to get the cgroup pattern to catch has to be
 improved (short term) in order to catch the new patterns: "docker-ce",
 "docker-ee", "kubernetes" ones and "ecs".
 => This to be solved need to see an update of the plugin with this fix
 at least. Long term would be to find another way of detecting the container
 inception, or providing customizable configs for this.



 On Monday, January 22, 2018 at 5:49:08 AM UTC+1, Giles Gaskell wrote:
>
> Thanks for your speedy reply Mark,
>
> I ended up raising a bug report here: https://issues.jenkins-c
> i.org/browse/JENKINS-49063
>
> This behavior is definitely manifesting itself through the Jenkins LTS
> release 2.89.3. In fact, I'm using a recent update of the
> "jenkinsci/blueocean" Docker image - see the 

Re: Kubernetes-Plugin BadRequest container name must be specified

2018-01-22 Thread Carlos Sanchez
Yes you are missing the container name at the end

kubectl logs jenkins-slave-1kl4v-flv53 golang

On Mon, Jan 22, 2018, 21:01 Chris Denneen <cdenn...@gmail.com> wrote:

> I've installed latest LTS of jenkins and installed latest
> kubernetes-plugin.
>
> I've created 2 pipeline jobs to test:
>
> pod-golang from here (
> https://kumorilabs.com/blog/k8s-6-integrating-jenkins-kubernetes/)
> and one from Carlos Sanchez blog here (
> https://blog.csanchez.org/2016/10/25/jenkins-kubernetes-plugin-0-9-released/
> )
>
> Both pods create with the following logs and loop:
>
> work/capdev-kubernetes » kubectl logs jenkins-slave-1kl4v-flv53
> Error from server (BadRequest): a container name must be specified for pod
> jenkins-slave-1kl4v-flv53, choose one of: [golang jnlp]
>
> work/capdev-kubernetes » kubectl logs jenkins-slave-pwcwz-2k20s
> Error from server (BadRequest): a container name must be specified for pod
> jenkins-slave-pwcwz-2k20s, choose one of: [maven golang jnlp]
>
>
> Is there something else that needs to be done in order to get these to
> work?
>
> --
> 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/CAP0Su%2BKLQCYLtMb21%3DvKzRJAfUPZnMkncGpmp9D1zoB%2BAeh9qA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAP0Su%2BKLQCYLtMb21%3DvKzRJAfUPZnMkncGpmp9D1zoB%2BAeh9qA%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/CALHFn6PsL4j_GkSXD%3D_6QZHLhogiv3MC4koRkggf8P9%3D3Hee7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin: Option to run pod as different user (e.g. as root)

2018-01-10 Thread Carlos Sanchez
Yes runAsUser is what you need but it's not yet supported as a field in the
plugin

This will hopefully be supported soon, working on a way to directly import
Pod yaml




On Tue, Jan 9, 2018 at 4:20 PM, Torsten Gippert <torsten.gipp...@itergo.com>
wrote:

> Hello everybody,
>
>
> this question is about implementing an option to run a build pod (using
> the kubernetes plugin from Carlos Sanchez) as a different user.
>
> @Carlos: Great work, we love the ability to define our own pod templates!
>
>
> *Software versions:*
>
>-
>
>Jenkins version: 2.89.2
>-
>
>Kubernetes Plugin version: 1.1.2
>-
>
>Durable Task Plugin Version: 1.17
>
>
> *First, let's assume the following scenario:*
>
> One JNLP container and 2 containers with different images in a podTemplate.
>
>
>
>-
>
>jnlp container - image jenkins/jnlp-slave:alpine - running as user
>'jenkins' with uid 1 (ten thousand)
>-
>
>node container - image node:9.3-alpine - running as root user with uid
>0
>-
>
>gradle container - image gradle:4.4-alpine - running as user 'gradle'
>with uid 1000 (one thousand).
>
>
> *podTemplate from Jenkinsfile:*
>
> podTemplate(label: nodeLabel, containers: [
>
>   containerTemplate(name: 'node', image: 'node:9.3-alpine', ttyEnabled:
> true, command: 'cat'),
>
>   containerTemplate(name: 'gradle', image: 'gradle:4.4-alpine',
> ttyEnabled: true, command: 'cat')
>
> ])
>
> Switching into container 'gradle' is not possible due to permission denied
> errors (seems to be caused by the durable task plugin, but I am not sure
> about that).
> Root cause seems to be that the jnlp container runs with uid 1 (yes,
> ten thousand - the 'old' image jenkins/jnlp-slave:2.62 ran with uid 1000)
> and therefore the working directory has file/directory permissions that
> prevent other users except uid 1 and root (uid 0) from accessing the
> working directory.
>
>
>
> I also added a pod yaml file (see attachment pod-permission-denied.yaml)
> that shows the "problem":
> 1. You can run that pod (kubectl apply -f pod-permission-denied.yaml) and
> 2. start a shell in the different containers (kubectl exec -ti -c
> [jnlp|node|gradle] permission-denied sh) to
>
> 3. run some commands like ‘id’ or ‘whoami’ within a container to show you
> the different user-ids the containers are running with.
>
>
> See attachments
>
>-
>
>Jenkinsfile-permission-denied.groovy   (contains Jenkinsfile to
>reproduce the “problem”)
>-
>
>Jenkinsfile-permission-denied_output.txt   (contains the stdout of the
>Jenkins build job)
>-
>
>pod-permission-denied.yaml (simplified k8s pod declaration)
>
>
>
> *Suggested solution:*
>
> Add options to set '*runAsUser*' and '*fsGroup*' at podTemplate level to
> be able to get rid of permission problems.
>
>
> 'runAsUser' and 'fsGroup' stand for the user id (uid) and match the
> options from podSecurityContext at pod level in kubernetes pod
> specification (see https://kubernetes.io/docs/tas
> ks/configure-pod-container/security-context/)
>
>
> *suggested p**odTemplate from Jenkinsfile:*
>
> podTemplate(label: nodeLabel, *runAsUser: 0, fsGroup: 0*,
>
> containers: [
>
>   containerTemplate(name: 'node', image: 'node:9.3-alpine', ttyEnabled:
> true, command: 'cat'),
>
>   containerTemplate(name: 'gradle', image: 'gradle:4.4-alpine',
> ttyEnabled: true, command: 'cat')
>
> ])
>
>
>
>
>
>
> The pod ‘run-as-root’ (see attachment pod-run-as-root.yaml) is a minimal
> modified version of the pod ‘permission-denied’ (see above) with a
> different pod security context:
>
>
> securityContext:
>
>   runAsUser: 0
>
>   fsGroup: 0
>
>
> 1. You can run that pod (kubectl apply -f pod-run-as-root.yaml) and
> 2. start a shell in the different containers (kubectl exec -ti -c
> [jnlp|node|gradle] run-as-root sh) to
>
> 3. run some commands like ‘id’ or ‘whoami’ within a container to show you that
> *each container is running as root now*.
>
> Therefore no permission denied problems *should* occur if this will be
> implemented in the kubernetes plugin.
>
> See attachments
>
>-
>
>pod-run-as-root.yaml (simplified k8s pod declaration with
>podSecurityContext set to root user)
>
>
>
>
>
> *What do you think? Could this be a proper way to “override” the the
> container specific default users?*
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop 

Re: Kubernetes plugin ( want to run slave as pod )

2018-01-04 Thread Carlos Sanchez
kubectl logs your_pod_slave has to print something, with that we could
probably help you better

Please stop hijacking jira issues and other email threads to enter
unrelated comments.


On Tue, Jan 2, 2018 at 8:29 PM, Vamsi krishna <vamsikrishna@gmail.com>
wrote:

>
>
> On Saturday, December 30, 2017 at 10:29:58 AM UTC-8, Carlos Sanchez wrote:
>>
>> what logs and events are you getting when you run
>>
>> * kubectl logs your_pod_slave
>> * kubectl describe your_pod_slave
>>
>> are you getting "failed to open log file" there? if you do it looks like
>> a kubernetes issue, like https://github.com/kubern
>> etes/kubernetes/issues/45911 that points to your container running out
>> of memory
>>
>
>
> my pod is runnning fine in kubernetes  but jenkins not able to take
> that  container to run the job.. is this issue with backend service.. i
> mean when pod is running succesfull then kubernetes assigns the pod to
> jenkins to run the job its concept wise. but my issue is, in that pod
> jenkins not able to run the job..
> pods logs showing nothing my reverse jnlp slave port should be 5
> or i can put any fixed port number??
>
> --
> 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/ms
> gid/jenkinsci-users/ad262af9-5a79-444c-86f6-6a2ae5a7f2fe%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/ad262af9-5a79-444c-86f6-6a2ae5a7f2fe%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/CALHFn6MXnJ3ifm-gO%2B7vvCmePGs7pgFnH_sYycAv7nnDDqxyPw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2018-01-03 Thread Carlos Sanchez
I don't think it is possible, a volumes field would need to be added to
KubernetesDeclarativeAgent
https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesDeclarativeAgent.java

On Wed, Jan 3, 2018 at 4:46 PM, Tim Zhukov <zlance...@gmail.com> wrote:

> Hey All,
>
> Is volume support still in development? I would like to use declarative
> syntax with k8s plugin, but our agent containers share persistence across
> pod with volume mounts.
>
> --
> Best
> Tim Zhukov
>
>
> On Friday, September 22, 2017 at 12:11:28 PM UTC-4, Vincent Heet wrote:
>>
>> Hi Chris,
>>
>> No I didn't. I ended up rewriting my Jenkinsfile in the non-declarative
>> Groovy format which worked like a charm.
>>
>> Greetings, Vincent
>>
>> On Friday, September 22, 2017 at 11:29:40 AM UTC+2, Chris Willmore wrote:
>>>
>>> Hey Vincent - did you ever give this a try? I'm looking at doing this
>>> now and was wondering if you ran into any blockers.
>>> -Chris
>>>
>>> On Thursday, August 10, 2017 at 1:03:46 PM UTC+3, Vincent Heet wrote:
>>>>
>>>> Ok so maybe i'm able to add this myself next week. I looked at the
>>>> class you mentioned but would adding the PodTemplate class as a property
>>>> there fix my issue? And I'm not sure why you mention volumes, volumes would
>>>> then be supported from the PodTemplate if I understand this correctly?
>>>>
>>>>
>>>> On Thursday, August 10, 2017 at 10:27:14 AM UTC+2, Carlos Sanchez wrote:
>>>>>
>>>>> It is not yet possible. Volumes would need to be added to the class
>>>>> https://github.com/jenkinsci/kubernetes-plugin/blob/
>>>>> master/src/main/java/org/csanchez/jenkins/plugins/kubernetes
>>>>> /pipeline/KubernetesDeclarativeAgent.java
>>>>>
>>>>> On Thu, Aug 10, 2017 at 9:22 AM, Vincent Heet <vince...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I configured a declarative pipeline with the kubernetes-plugin to
>>>>>> start a jenkins job's in a k8s cluster. This is working great but now I
>>>>>> want to use volumes for secrets and need to specify a podTemplate. I'm 
>>>>>> not
>>>>>> sure how to configure a podTemplate for a declarative pipeline. The
>>>>>> pipeline that is working:
>>>>>>
>>>>>>
>>>>>> pipeline {
>>>>>> agent {
>>>>>> kubernetes {
>>>>>> label 'jenkins-demo'
>>>>>> containerTemplate {
>>>>>> name 'dind-jdk8-maven3'
>>>>>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
>>>>>> ttyEnabled true
>>>>>> command 'cat'
>>>>>> }
>>>>>> }
>>>>>> }
>>>>>> stages {
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> The above I would like to extend with a podTemplate containing
>>>>>> volumes and a secretVolume. The issue is that I don't know the correct
>>>>>> syntax for specifying a podTemplate in the declarative pipeline. So I 
>>>>>> came
>>>>>> up with this:
>>>>>>
>>>>>>
>>>>>> pipeline {
>>>>>> agent {
>>>>>> kubernetes {
>>>>>> label 'jenkins-demo'
>>>>>> podTemplate {
>>>>>> volumes {
>>>>>> secretVolume(secretName: 'some-secret', mountPath
>>>>>> : '/some-secret')
>>>>>> }
>>>>>> containerTemplate {
>>>>>> name 'dind-jdk8-maven3'
>>>>>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4
>>>>>> '
>>>>>> ttyEnabled true
>>>>>> command 'cat'
>>>>>> }
>>>>>> }
>>>>>> }
>>>>>> }
>>>>>> stages {
>>>>>> }
>

Re: Kubernetes plugin ( want to run slave as pod )

2017-12-30 Thread Carlos Sanchez
what logs and events are you getting when you run

* kubectl logs your_pod_slave
* kubectl describe your_pod_slave

are you getting "failed to open log file" there? if you do it looks like a
kubernetes issue, like https://github.com/kubernetes/kubernetes/issues/45911
that points to your container running out of memory



On Thu, Dec 28, 2017 at 6:51 PM, Vamsi krishna 
wrote:

> Hello Team,
>
> I am using kubernetes plugin 1.1
> My cluster is running in local Host.. Jenkins is running in outside
> cluster..
> I want to run my Jenkins build jobs with slave pod in containers..after
> build job is done my slave pod has to kill automatically..
> Pod is killing automatically when build job is done..but issue is
> My job is running on jenkins/jnlp-slave image not in my base image.for
> that I mentioned jnlp as my container name then job is not able to run
> showing pending slave-td45h is offline.
>
> How to connect my container to  talk to the Jenkins. I am trying for the
> freestyle jobs.
>
> I created image with making baseimage of  in my dockerfike i mentioned
> FROM Jenkins/jnlp-slave is it right to use like this..
> If u want I will show my total dockerfile..
>
> From jenkins/jnlp-slave
> USER root
>
> ENV NPM_CONFIG_LOGLEVEL info
> ENV NODE_VERSION 8.9.0
> ENV COMPOSE_VERSION 1.12.0
>
> # NodeJS (from https://github.com/nodejs/docker-node/blob/
> 12ba2e5432cd50037b6c0cf53464b5063b028227/8.1/Dockerfile)
> # gpg keys listed at https://github.com/nodejs/node#release-team
> RUN set -ex \
>   && for key in \
> 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
> FD3A5288F042B6850C66B31F09FE44734EB7990E \
> 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
> DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
> C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
> B9AE9905FFD7803F25714661B63B535A4C206CA9 \
> 56730D5401028683275BD23C23EFEFE93C4CFFFE \
> 77984A986EBC2AA786BC0F66B01FBB92821C587A \
>   ; do \
> gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
> gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
> gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
>   done
>
>
> RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
>   && case "${dpkgArch##*-}" in \
> amd64) ARCH='x64';; \
> ppc64el) ARCH='ppc64le';; \
> s390x) ARCH='s390x';; \
> arm64) ARCH='arm64';; \
> armhf) ARCH='armv7l';; \
> *) echo "unsupported architecture"; exit 1 ;; \
>   esac \
>   && curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_
> VERSION-linux-$ARCH.tar.xz" \
>   && curl -SLO --compressed "https://nodejs.org/dist/v$
> NODE_VERSION/SHASUMS256.txt.asc" \
>   && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
>   && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt |
> sha256sum -c - \
>   && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local
> --strip-components=1 \
>   && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc
> SHASUMS256.txt \
>   && ln -s /usr/local/bin/node /usr/local/bin/nodejs
>
> RUN apt-get update && apt-get install -y git jq rsync g++ build-essential
> && apt-get clean
>
> ADD jenkins-slave /usr/local/bin
>
> USER jenkins
>
> using this image my container is not running properly getting logs as failed
> to open log file "/var/log/pods/70d9def9-ebf7-
> 11e7-867e-005056bf5570/jnlp_0.log": open /var/log/pods/70d9def9-ebf7-
> 11e7-867e-005056bf5570/jnlp_0.log: no such file or directory
> these are the logs  i am getting any idea... if this container runs
> succesfully then i can run my jenkins job in this container. because i did
> base image as jenkins/jnlp-slave.   Can anyone please help me.. I have this
> issue since week.
>
> --
> 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/c1d734a7-d4f7-444b-8689-81ab3929384b%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/CALHFn6N0Y0iCwKniof%2BpSzEq9HMF0TbgqO_Lx9WWt%3DNE5ko2Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin - Add ‘Environment Variable’ Button is not functional in Jenkins ‘Configure System’ under ‘Container Template’

2017-11-01 Thread Carlos Sanchez
It's a known issue
https://issues.jenkins-ci.org/plugins/servlet/mobile#issue/JENKINS-47112

On Wed, Nov 1, 2017, 16:29 Avi Segev  wrote:

>
>
> Versions used:  Jenkins ver.  2.60.1, Kubernetes plugin version 1.0 (also
> tested on version 1.1).
>
>
> We have a functional dynamically provisioned Jenkins slave that was
> initially configured with a container template and a few environment
> variables.
>
> For some reason the buttons ‘Add Environment Variable’ in the Jenkins
> Configure form (under the ‘Cloud’ section) are no longer functional (the
> button / drop down list is empty)
>
>
>
> *Notes*
>
>
>- The following may be related; we also observed that when the
>‘Jenkins   Configure System’ form is saved there is a server log with the
>following warning:
>
> Nov 01, 2017 12:04:24 AM hudson.model.Descriptor verifyNewInstance
>
> WARNING: Father of ContainerEnvVar [getValue()=xyz, getKey()=kkk] and its
> getDescriptor() points to two different instances. Probably malplaced
> @Extension. See
> http://hudson.361315.n4.nabble.com/Help-Hint-needed-Post-build-action-doesn-t-stay-activated-td2308833.html
>
>
>- The provisioned slave works fine with the existing configured
>environment variables present in the container as expected. The issue that
>we have is adding new Pod Templates with container templates and
>environment variables.
>
>
>
>
>
>
>
>
>
> --
> 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/e7cb8fa7-a7f9-4069-8602-45621c641d94%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/CALHFn6N5Y7fwpay_pWW%3Dn7YWDL8T6OjxHkB5KXMjgiWeDf2iKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Failed to connect to http://jenkins.build-env.svc.cluster.local:8080/tcpSlaveAgentListener/: jenkins.build-env.svc.cluster.local

2017-10-05 Thread Carlos Sanchez
you are correct your kubernetes DNS can't resolve the name, assuming you
have a service jenkins in the build-env namespace

On Thu, Oct 5, 2017 at 4:09 PM, WANG, YAN-HONG 
wrote:

> Hello,
>
> My environment:
> Jenkins: 2.73.1
> Jenkins plugin (kubernetes: *1.0*).
> Kuberntes Server: *v1.7.7* ( One master and one minion)
> Platform: Ubuntu 16.04 (in *Synnefo *cluster environment)
>
> When I execute pipeline job with kubernetes plugin in Jenkins environment.
>
> The slave-jksnf-q6dlr is stay in "offline" state.
>
> *$ ​kubectl --namespace=build-env logs slave-jksnf-q6dlr jnlp*
> Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to
> alter the behavior
> Warning: SECRET is defined twice in command-line arguments and the
> environment variable
> Warning: AGENT_NAME is defined twice in command-line arguments and the
> environment variable
> Oct 05, 2017 1:29:32 PM hudson.remoting.jnlp.Main createEngine
> INFO: Setting up slave: slave-jksnf-q6dlr
> Oct 05, 2017 1:29:32 PM hudson.remoting.jnlp.Main$CuiListener 
> INFO: Jenkins agent is running in headless mode.
> Oct 05, 2017 1:29:32 PM hudson.remoting.Engine startEngine
> WARNING: No Working Directory. Using the legacy JAR Cache location:
> /home/jenkins/.jenkins/cache/jars
> Oct 05, 2017 1:29:32 PM hudson.remoting.jnlp.Main$CuiListener status
> INFO: Locating server among [http://jenkins.build-env.svc.
> cluster.local:8080/]
> Oct 05, 2017 1:29:37 PM hudson.remoting.jnlp.Main$CuiListener error
> SEVERE: Failed to connect to http://jenkins.build-env.svc.
> cluster.local:8080/tcpSlaveAgentListener/: jenkins.build-env.svc.cluster.
> local
> java.io.IOException: Failed to connect to http://jenkins.build-env.svc.
> cluster.local:8080/tcpSlaveAgentListener/: jenkins.build-env.svc.cluster.
> local
> at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(
> JnlpAgentEndpointResolver.java:161)
> at hudson.remoting.Engine.innerRun(Engine.java:495)
> at hudson.remoting.Engine.run(Engine.java:447)
> Caused by: java.net.UnknownHostException: jenkins.build-env.svc.cluster.
> local
> at java.net.AbstractPlainSocketImpl.connect(
> AbstractPlainSocketImpl.java:184)
> at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
> at java.net.Socket.connect(Socket.java:589)
> at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
> at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
> at sun.net.www.http.HttpClient.(HttpClient.java:242)
> at sun.net.www.http.HttpClient.New(HttpClient.java:339)
> at sun.net.www.http.HttpClient.New(HttpClient.java:357)
> at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(
> HttpURLConnection.java:1202)
> at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(
> HttpURLConnection.java:1138)
> at sun.net.www.protocol.http.HttpURLConnection.plainConnect(
> HttpURLConnection.java:1032)
> at sun.net.www.protocol.http.HttpURLConnection.connect(
> HttpURLConnection.java:966)
> at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(
> JnlpAgentEndpointResolver.java:158)
> ... 2 more
>
> It looks seem DNS can't solve name issue? or?
> But, in minikube environment, there is no this problem...
>
> Thanks very much.
>
> Hong
>
> --
> 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/CADLWyO2XJG-50ouKNe7yVm6BiQ_-
> cYoxQQrWg7P2iRRX7FZ%3DAA%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/CALHFn6MzS_EW_Fn4CQYb%2BRhi4xk7C7kuJ%2BBV-HjD%2Byp8b%3DaTvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked.

2017-10-03 Thread Carlos Sanchez
That means you don't have the right RBAC roles setup for the default SA in
kubernetes. By default you get no permissions

On Mon, Oct 2, 2017 at 3:38 PM, WANG, YAN-HONG 
wrote:

> Hi
>
> I meet a error message while I tried "*Test Connection*"
>
> *Error connecting to https://kubernetes.default.svc.cluster.local
> : Failure executing: GET at:
> https://kubernetes.default.svc.cluster.local/api/v1/namespaces/build-env/pods
> .
> Message: Forbidden!Configured service account doesn't have access. Service
> account may have been revoked. User
> "system:serviceaccount:build-env:default" cannot list pods in the namespace
> "build-env"...*
>
> My environment:
> Platform: Ubuntu 16.04
> Jenkins: 2.73.1
> Jenkins plugin (kubernetes:1.0).
> Kuberntes Server: v1.7.7
>
> There are some similar issue could also be found here.
> https://issues.jenkins-ci.org/browse/JENKINS-41388
> https://groups.google.com/forum/#!topic/fabric8/H-UGSFJLC6g
>
> Is there anyone know about this issue?
>
> Thanks very much.
>
> Hong
>
> --
> 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/CADLWyO0a2uWcc%3DRZ-u4LfTv5CZ3uG7jam7oQJdb%
> 2BR46MJsUfLQ%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/CALHFn6OFo%2BN70TLSPbimkOav1%3D_oExhzLKC0nF_aDwYBPLHDpg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins global configuration after container starts

2017-09-22 Thread Carlos Sanchez
You don't need to use helm, I meant that you can look at how helm does it

On Wed, Sep 13, 2017 at 12:27 PM, robert tingirica <
tingirica.rob...@gmail.com> wrote:

> Thank you for your answer Carlos,
>
> I will definitely consider using helm more in the future.
>
> If you are referring to https://github.com/kubernet
> es/charts/tree/master/stable/jenkins , the last step is exactly a manul
> step that I want to avoid:
>
> "Under configure Jenkins -- Update the credentials config in the cloud
> section to use the service account credential you created in the step
> above."
>
> It doesn't present any way of configuring other tools without changing the
> whole template and adding new values, which requires further maintenance.
> It would also mean introducing a new tool (helm) in our organisation,
> which I am willing to do, but it will take months to security approve it.
> Further configuration on the master cannot be done without another
> deployment (same case if I script it at start-up, in the container, but
> that doesn't require internal corporate process loop jumping) and this is
> the main reason I would like to use a REST API, if it exists.
>

I didn't say to use helm, just to check how helm does it.
ie. https://github.com/kubernetes/charts/blob/master/
stable/jenkins/templates/config.yaml

About REST there is nothing special in the plugin, there is whatever is
already available in jenkins global configuration


>
> Kind regards
>
>
> On Wednesday, 13 September 2017 11:28:21 UTC+2, Carlos Sanchez wrote:
>>
>> check the jenkins helm chart, it is doing that already
>>
>> On Wed, Sep 13, 2017 at 11:01 AM, robert tingirica <tingiric...@gmail.com
>> > wrote:
>>
>>> Hello,
>>>
>>> We are using Jenkins in our environment with the kubernetes plugin. We
>>> are currently configuring credentials and creating jobs using the API, but
>>> I see no way to do this initially with global configuration.
>>>
>>> Examples of configs we need to change:
>>> - Use master node only when specified by name
>>> - Add new cloud
>>> - Maven Project Configuration
>>> - Add sonarqube server
>>>
>>> I have tried creating a new image and copying the config.xml file, if it
>>> does not exist in $JENKINS_HOME but then we can’t take advantage of the
>>> initial run that jenkins.war does which creates the admin user and so on.
>>>
>>> Is there a way to configure the desired sections using REST calls?
>>> What would be the best way to achieve this?
>>>
>>> Using jenkins-cli isn’t really in our scope.
>>>
>>>
>>> Thank you
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.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/ms
> gid/jenkinsci-users/e883c79b-2b1e-40c5-990e-4345367a89f6%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/e883c79b-2b1e-40c5-990e-4345367a89f6%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/CALHFn6P4G5CWm1QoAQ7bhim36dDsp5FoOew5nLbmbHqhXZHgww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins global configuration after container starts

2017-09-13 Thread Carlos Sanchez
check the jenkins helm chart, it is doing that already

On Wed, Sep 13, 2017 at 11:01 AM, robert tingirica <
tingirica.rob...@gmail.com> wrote:

> Hello,
>
> We are using Jenkins in our environment with the kubernetes plugin. We are
> currently configuring credentials and creating jobs using the API, but I
> see no way to do this initially with global configuration.
>
> Examples of configs we need to change:
> - Use master node only when specified by name
> - Add new cloud
> - Maven Project Configuration
> - Add sonarqube server
>
> I have tried creating a new image and copying the config.xml file, if it
> does not exist in $JENKINS_HOME but then we can’t take advantage of the
> initial run that jenkins.war does which creates the admin user and so on.
>
> Is there a way to configure the desired sections using REST calls?
> What would be the best way to achieve this?
>
> Using jenkins-cli isn’t really in our scope.
>
>
> Thank you
>
> --
> 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/B65A7820-D337-4358-98A9-9A062DE7226C%40gmail.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/CALHFn6O8VdMHwS5gy2W_eaSzwFNt%2BM5i89Xa50LNiGm5%2BrWrhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help with kubernetes jenkins plugin setup

2017-09-04 Thread Carlos Sanchez
On Mon, Sep 4, 2017 at 4:57 PM, Alex B  wrote:

> I am trying to setup Jenkins to use Kubernetes for build agents on Azure.
> Right now I have an instance of Jenkins running in a VM and an instance of
> Kubernetes setup in Azure using Azure container service.
>
> My Jenkins instance is working and Kubernetes is working. I've installed
> the kubernetes plugin for Jenkins but when I go to configure kubernetes
> under the cloud options I run into issues.
>
> How do I configure the cloud settings so I can get Jenkins to use
> Kubernetes for build agents?
>
> Which URL do I use for the "Kubernetes URL"?
>

that will be provided by azure, check kubectl config view


>
> Which cert do I use for "Kubernetes server certificate key"?
>

> Which credentials do I use for "Credentials"? When I run kubectl config
> view I do not have a password but do have a user and certs.
>

https://illya-chekrygin.com/2017/08/26/configuring-certificates-for-jenkins-kubernetes-plugin-0-12/
or https://github.com/jenkinsci/kubernetes-plugin#configuration-on-minikube


>
>
>
>
> I have no requirement to run Jenkins in its own VM and would be willing to
> move it to run on Kubernetes if it makes using this plugin easier.
>

in kubernetes it will be able to autoconfigure in the next version


>
> --
> 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/b351f98e-480e-49d1-9172-8cfb104f6d36%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/CALHFn6O0d-wiodgXx5ckHrPpTFRaiZF%3DHj5V3twv%2Bt7fYdjghA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No credentials/secrets pulled from master into PodTemplate/ContainerTemplate by Jenkins Kubernetes Plugin during pipeline execution?

2017-09-03 Thread Carlos Sanchez
To pull images from private registries you need the imagePullSecrets option
(not yet released for pipeline, will be in 1.0)
For credentials you would need to do something with them, ie. put them in
an environment variable and then use it in the containers. This has also
been improved/fixed for 1.0


On Sun, Sep 3, 2017 at 10:26 AM, Vedran Lerenc  wrote:

> Hi,
>
> Setting the scene:
> I have set up a multi-node Kubernetes cluster [1] and deployed the Jenkins
> Helm Chart [2] with the Jenkins Kubernetes plugin [3]. We run
> (company-)internally an Enterprise GitHub installation and we have multiple
> private and public repos. The builds are implemented using non-declarative
> Jenkins pipelines [4] (many features are missing in the plugin for
> declarative pipelines [5]). The builds don't run on the Jenkins master, but
> every job run consumes its own pod for obvious reasons (maximum scale-out
> and total isolation/no side effects) via podTemplates/containerTemplates
> [6].
>
> The problem/question:
> I found no way or description how to fetch from private repos or, more
> generally spoken, I found no way to pull any credentials/secrets from the
> Jenkins master (where I like to maintain them centrally) into the
> pods/containers that the plugin creates for my job runs, i.e. I miss in
> those pods/containers e.g. the credentials/secrets to pull from a private
> repo. How can I make those available in the dynamically spawned
> pods/containers? Is that even possible?
>
> Some additional information:
> On my Jenkins master I can perfectly fetch from private repos, have access
> to everything and all is fine. It's only lately that I tried to use the
> Kubernetes plugin and get more out of my cluster. Also, I `kubectl exec`'d
> into the JNLP slave container (and its siblings based on my
> containerTemplates) and couldn’t find anything. Not in the ENV, not in
> files. It is not clear to me how my credentials/secrets would get injected,
> and what I need to do for it.
>
> Dirty solutions I already use, but I like to replace:
> To overcome the problem, I put my credentials into the JenkinsFile, but
> that's bad because I now smear them across my repos and it's no solution
> for the public repos either. What I also did was to bake them into my
> images for the pod/container templates, but that's ugly for similar reasons
> as I put them now into DockerFiles (directly or indirectly during the
> build) and can't use off-the-shelf images anymore and can't put mine into
> public image repos anymore, too. I guess it would be also possible to
> modify my top-most podTemplate/containerTemplate and manually add ENV vars
> with the credentials/secrets, but that's ugly as well as I wouldn't make
> use of the Jenkins master credentials/secrets store anymore.
>
> Can someone please help? I look for a clean solution to the problem. I
> hope, it's possible to bring my credentials/secrets from the Jenkins master
> into my dynamically spawned pods/containers that I also like to keep (no
> static slaves, but dynamic ones for each and every job run).
>
> Thanks in advance, Vedran
>
> [1] https://kubernetes.io
> [2] https://github.com/kubernetes/charts/tree/master/stable/jenkins
> [3] https://github.com/jenkinsci/kubernetes-plugin
> [4] https://jenkins.io/doc/book/pipeline
> [5] https://groups.google.com/forum/#!topic/jenkinsci-users/DEwTX-C5ct4
> [6] https://github.com/jenkinsci/kubernetes-plugin#pod-and-
> container-template-configuration
>
> --
> 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/1caaec44-8c6f-4499-a32c-e29145908c4d%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/CALHFn6MmQ%2BYFaOSf_TkAd95b9X91NmNbqS9n9zoMFcwaeVML6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating Jenkins slaves using kubernetes-plugin that restart on node failures

2017-08-29 Thread Carlos Sanchez
It doesn't restart the agents because as soon as the agent crashes the
build will fail. So there is no point in restarting them

On Tue, Aug 29, 2017 at 5:30 PM, Cooper99  wrote:

> I am new to Jenkins so this may be a simple question.  I am using the
> kubernetes-plugin to dynamically create Jenkins slaves. The one thing I
> have noticed is that when using the plugin to create the slaves is if a
> node gets deleted the slave pod is running on, the slave pod is not
> restarted.  I am not sure if this is a configuration error on my part or
> just the way it is.  It seems that based on this article:
> https://www.infoq.com/articles/scaling-docker-kubernetes-v1 that having
> the slaves restart when a node goes down would always be desired.
> I am using Jenkins 2.66 and kubernetes-plugin 0.11 on Kubernetes 1.6.2.
>
> 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/4a04bd53-d927-406a-b8ba-6e346a5ece9b%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/CALHFn6M-wa-WkDMU%3D_v4Fk0p3eKDKij%2BWXikvUOtRVXFNkk%2B_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kubernetes Plugin

2017-08-24 Thread Carlos Sanchez
I've seen it reported before.
Check your pod logs, events and exit codes

On Thu, Aug 24, 2017 at 6:35 PM, Pedro Januário 
wrote:

> Hi,
>
> I am using Jenkins Pipeline with Kubernetes Plugin and doing something
> really simple just to build a container and run the container to execute
> the tests on it.
>
> While doing it I got a error that shows exit -2 without another
> information, currently I am just doing a echo.
>
> *Example (just part of it):*
>
> def containersForUnitTest = [
>   containerTemplate(name: 'mongotest',
>   image: 'mongo:3.2.4',
>   ttyEnabled: true, command: 'mongod --smallfiles',
>   resourceLimitCpu: '150m',
>   resourceRequestCpu: '100m',
>   resourceRequestMemory: '512Mi',
>   resourceLimitMemory: '512Mi',
>   alwaysPullImage: false),
>   containerTemplate(name: 'microservice',
>   image: "..myimage...",
>   ttyEnabled: true, command: 'cat',
>   resourceLimitCpu: '150m',
>   resourceRequestCpu: '100m',
>   resourceRequestMemory: '512Mi',
>   resourceLimitMemory: '512Mi')
> ]
>
> podTemplate(name: "test", inheritFrom: 'jnlp', label: test", containers:
> containersForUnitTest) {
>   node("some") {
> stage('Test') {
>   try {
> container('microservice') {
>   sh """
>echo "this is my echo thing"
>   """
> }
>   }
>   catch (Exception e) {
> echo "microservice error: ${e}"
> throw e
>   }
> }
>   }
> }
>
> If I add the following line to my dockerfile it will run successfully,
> this seems a awkward behaviour that seems to be related with permissions on
> the container execution. Don't see any other way to workaround this but it
> seems undesired.
>
> RUN chown node:node $APP_DIR \
>   && echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >>
> /etc/apk/repositories \
>   && apk --no-cache add shadow && usermod -u 1 node
>
> Any clue? Is there anything that can cause 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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/b921176c-33ca-48c2-a06e-a673aa6f6e72%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/CALHFn6MuQuzz7N4FSdrhvCEXjoOx5C%3DU3s57%2BmdCM40HNbonag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-18 Thread Carlos Sanchez
The you would need 2 podTemplate entries, one after another

On Thu, Aug 17, 2017 at 10:59 PM, WANG, YAN-HONG <allways.w...@gmail.com>
wrote:

> Hello Carlos,
>
> Thanks for your reply and explanation.
>
> My situation is that one of container *images* *doesn't exist* in the
> *beginning* of pod creation.
> And then that container image will be established in the "*build stage*"
> of pipeline execution.
>
> So that is why I cannot let this containerTemplate *claimed in the
> beginning* of *Pod Definition*.
>
> Best regards,
> Hong
>
> 2017-08-16 17:01 GMT+02:00 Carlos Sanchez <car...@apache.org>:
>
>>
>>
>> On Wed, Aug 16, 2017 at 1:55 PM, YAN-HONG WANG <allways.w...@gmail.com>
>> wrote:
>>
>>> Hello Carlos,
>>>
>>> Now in my Jenkinsfile.groovy I create a *slave container* in *other pod*
>>> .
>>> I use "*load*" this function to implement.
>>>
>>> But, I found out that *pod *will be *destroyed automatically* when that 
>>> *slave
>>> container* was executed.
>>> That slave container is a PostgreSQL daemon. That needs to be held for
>>> waiting other container binding.
>>> And then unfortunately that *slave container was destroyed by destroyed
>>> pod.*
>>>
>>> Is there any *syntax *or *podTemplate argument* can avoid pod destroyed
>>> automatically?
>>>
>>
>> You can create multiple containers as part of a pod, then can use them
>> until podTemplate is closed, when the pod is destroyed
>>
>>
>>>
>>> Thanks very much.
>>>
>>> Best regards,
>>> Hong
>>>
>>>
>>> Am Montag, 14. August 2017 21:58:46 UTC+2 schrieb YAN-HONG WANG:
>>>>
>>>> Hello Carlos,
>>>>
>>>> Thanks for your hint.
>>>> I will try to create new container in other new pod.
>>>>
>>>> Hong
>>>>
>>>> Am Montag, 14. August 2017 21:20:03 UTC+2 schrieb Carlos Sanchez:
>>>>>
>>>>> You can not add containers to a pod after the pod is created, that
>>>>> doesn't work in kubernetes nor docker swarm
>>>>>
>>>>> On Mon, Aug 14, 2017 at 8:44 PM, YAN-HONG WANG <allway...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hello Carlos,
>>>>>>
>>>>>> If I use the container created function like below:
>>>>>>
>>>>>> def dbImage = *docker.image*( "myregistry:5000/imagename:1.0.0.1" )
>>>>>> def c = *dbImage.run*("--network jenkins-network --name mycontainer")
>>>>>>
>>>>>> But, this container seems will be created *in host* side, *not in*
>>>>>> Kubernetes side, right?
>>>>>>
>>>>>> So this container even was created ... but it could *not*
>>>>>> communicate with *other container* ...
>>>>>>
>>>>>> Best regards,
>>>>>> Hong
>>>>>>
>>>>>>
>>>>>> Am Montag, 14. August 2017 20:32:19 UTC+2 schrieb YAN-HONG WANG:
>>>>>>>
>>>>>>> Hello Carlos,
>>>>>>>
>>>>>>> Thanks for correction.
>>>>>>> But, if containerTemplate can't be defined outside of podTemplate.
>>>>>>>
>>>>>>> How could I *create* a container in the *execution of pipeline*?
>>>>>>> And that container can also *stay* in the *same* pod.
>>>>>>> Is there some other *syntax* or some *container creation function*
>>>>>>> could be applied in *node area*?
>>>>>>>
>>>>>>> Thanks very much again.
>>>>>>>
>>>>>>> Best regards,
>>>>>>> Hong
>>>>>>>
>>>>>>> Am Montag, 14. August 2017 09:42:11 UTC+2 schrieb Carlos Sanchez:
>>>>>>>>
>>>>>>>> you can't define containers outside podTemplate
>>>>>>>>
>>>>>>>> On Fri, Aug 11, 2017 at 11:55 PM, YAN-HONG WANG <
>>>>>>>> allway...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hello Carlos,
>>>>>>>>>
>>>>>>>>> I tried it already with all *plain hard code*. And insert in the
>>>>>>>

Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-16 Thread Carlos Sanchez
On Wed, Aug 16, 2017 at 1:55 PM, YAN-HONG WANG <allways.w...@gmail.com>
wrote:

> Hello Carlos,
>
> Now in my Jenkinsfile.groovy I create a *slave container* in *other pod*.
> I use "*load*" this function to implement.
>
> But, I found out that *pod *will be *destroyed automatically* when that *slave
> container* was executed.
> That slave container is a PostgreSQL daemon. That needs to be held for
> waiting other container binding.
> And then unfortunately that *slave container was destroyed by destroyed
> pod.*
>
> Is there any *syntax *or *podTemplate argument* can avoid pod destroyed
> automatically?
>

You can create multiple containers as part of a pod, then can use them
until podTemplate is closed, when the pod is destroyed


>
> Thanks very much.
>
> Best regards,
> Hong
>
>
> Am Montag, 14. August 2017 21:58:46 UTC+2 schrieb YAN-HONG WANG:
>>
>> Hello Carlos,
>>
>> Thanks for your hint.
>> I will try to create new container in other new pod.
>>
>> Hong
>>
>> Am Montag, 14. August 2017 21:20:03 UTC+2 schrieb Carlos Sanchez:
>>>
>>> You can not add containers to a pod after the pod is created, that
>>> doesn't work in kubernetes nor docker swarm
>>>
>>> On Mon, Aug 14, 2017 at 8:44 PM, YAN-HONG WANG <allway...@gmail.com>
>>> wrote:
>>>
>>>> Hello Carlos,
>>>>
>>>> If I use the container created function like below:
>>>>
>>>> def dbImage = *docker.image*( "myregistry:5000/imagename:1.0.0.1" )
>>>> def c = *dbImage.run*("--network jenkins-network --name mycontainer")
>>>>
>>>> But, this container seems will be created *in host* side, *not in*
>>>> Kubernetes side, right?
>>>>
>>>> So this container even was created ... but it could *not* communicate
>>>> with *other container* ...
>>>>
>>>> Best regards,
>>>> Hong
>>>>
>>>>
>>>> Am Montag, 14. August 2017 20:32:19 UTC+2 schrieb YAN-HONG WANG:
>>>>>
>>>>> Hello Carlos,
>>>>>
>>>>> Thanks for correction.
>>>>> But, if containerTemplate can't be defined outside of podTemplate.
>>>>>
>>>>> How could I *create* a container in the *execution of pipeline*?
>>>>> And that container can also *stay* in the *same* pod.
>>>>> Is there some other *syntax* or some *container creation function*
>>>>> could be applied in *node area*?
>>>>>
>>>>> Thanks very much again.
>>>>>
>>>>> Best regards,
>>>>> Hong
>>>>>
>>>>> Am Montag, 14. August 2017 09:42:11 UTC+2 schrieb Carlos Sanchez:
>>>>>>
>>>>>> you can't define containers outside podTemplate
>>>>>>
>>>>>> On Fri, Aug 11, 2017 at 11:55 PM, YAN-HONG WANG <allway...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hello Carlos,
>>>>>>>
>>>>>>> I tried it already with all *plain hard code*. And insert in the
>>>>>>> execution of pipeline.
>>>>>>>
>>>>>>> Something like this below:
>>>>>>>
>>>>>>> podTemplate(
>>>>>>>
>>>>>>>   label: "pod",
>>>>>>>
>>>>>>>   containers: [
>>>>>>> containerTemplate(
>>>>>>>   name: "*worker*",
>>>>>>>   image: "myregistry:5000/jenkins-worker:latest",
>>>>>>>   envVars:[
>>>>>>> containerEnvVar( key: "PGUSER", value: "pguser" ),
>>>>>>> containerEnvVar( key: "PGPASSWORD", value: "pgpassword" )
>>>>>>>   ],
>>>>>>>   alwaysPullImage: true,
>>>>>>>   ttyEnabled: true,
>>>>>>>   command: "cat"
>>>>>>> )
>>>>>>>   ]
>>>>>>> )
>>>>>>> {
>>>>>>> node( "pod" ) {
>>>>>>>
>>>>>>>   container( "*worker*" ) {
>>>>>>>
>>>>>>> stage( "DB Tests" ) {
>>>>>>>
>>>>>>>

Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-16 Thread Carlos Sanchez
will be in 0.13

On Wed, Aug 16, 2017 at 2:54 PM, YAN-HONG WANG 
wrote:

> Hello Carlos:
>
> Is method "*secretEnvVar*" already in *Kubernetes plugin 0.12*? Or that
> will be released in nearly future *0.13*?
>
> Because I got the error message like this ...
>
> *java.lang.NoSuchMethodError: No such DSL method 'secretEnvVar' found among 
> steps *
>
>
> Thanks very much.
>
> Best regards,
> Hong
>
> Am Donnerstag, 10. August 2017 22:42:22 UTC+2 schrieb YAN-HONG WANG:
>>
>> @Carlos, Thanks!!!
>>
>>
>> There is a PR for it https://github.com/jenkinsci/k
>>> ubernetes-plugin/pull/162
>>>
>>>
>>> Hi,

 In jenkins-kubernetes-plugin, is there any syntax that support using 
 *Secrets
 as environment variables* in *containerTemplate*?

 I just saw something from here.
 https://kubernetes.io/docs/concepts/configuration/secret/#
 using-secrets-as-environment-variables

 So some syntax like "*secretKeyRef*" could be indicated in
 *containerTemplate?*

 apiVersion: v1kind: Podmetadata:
   name: secret-env-podspec:
   containers:
 - name: mycontainer
   image: redis
   env:
 - name: SECRET_USERNAME
   valueFrom:
 secretKeyRef:
   name: mysecret
   key: username
 - name: SECRET_PASSWORD
   valueFrom:
 secretKeyRef:
   name: mysecret
   key: password
   restartPolicy: Never

 Thanks.

 Best regards,
 Hong

 --
 You received this message because you are subscribed to the Google
 Groups "Jenkins Users" group.
 To view this discussion on the web visit https://groups.google.com/d/ms
 gid/jenkinsci-users/a4be1cee-cfd4-48d8-a97e-fa5c30d95ce6%
 40googlegroups.com
 
 .
 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/to
>>> pic/jenkinsci-users/vAZbO6gCgIY/unsubscribe.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jenkinsci-users/CALHFn6Mht9PHnX7WNFMranPz-J6VvPaQkrx8ci_
>>> pDBQ1dGQXcA%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/ff873744-f9c1-46df-a32d-6cbd36b2966f%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/CALHFn6MDna-sEzUeE6quz9B6uujK5sNbH_UfUF7A%3DgRpdh0Xfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-14 Thread Carlos Sanchez
You can not add containers to a pod after the pod is created, that doesn't
work in kubernetes nor docker swarm

On Mon, Aug 14, 2017 at 8:44 PM, YAN-HONG WANG <allways.w...@gmail.com>
wrote:

> Hello Carlos,
>
> If I use the container created function like below:
>
> def dbImage = *docker.image*( "myregistry:5000/imagename:1.0.0.1" )
> def c = *dbImage.run*("--network jenkins-network --name mycontainer")
>
> But, this container seems will be created *in host* side, *not in*
> Kubernetes side, right?
>
> So this container even was created ... but it could *not* communicate
> with *other container* ...
>
> Best regards,
> Hong
>
>
> Am Montag, 14. August 2017 20:32:19 UTC+2 schrieb YAN-HONG WANG:
>>
>> Hello Carlos,
>>
>> Thanks for correction.
>> But, if containerTemplate can't be defined outside of podTemplate.
>>
>> How could I *create* a container in the *execution of pipeline*?
>> And that container can also *stay* in the *same* pod.
>> Is there some other *syntax* or some *container creation function* could
>> be applied in *node area*?
>>
>> Thanks very much again.
>>
>> Best regards,
>> Hong
>>
>> Am Montag, 14. August 2017 09:42:11 UTC+2 schrieb Carlos Sanchez:
>>>
>>> you can't define containers outside podTemplate
>>>
>>> On Fri, Aug 11, 2017 at 11:55 PM, YAN-HONG WANG <allway...@gmail.com>
>>> wrote:
>>>
>>>> Hello Carlos,
>>>>
>>>> I tried it already with all *plain hard code*. And insert in the
>>>> execution of pipeline.
>>>>
>>>> Something like this below:
>>>>
>>>> podTemplate(
>>>>
>>>>   label: "pod",
>>>>
>>>>   containers: [
>>>> containerTemplate(
>>>>   name: "*worker*",
>>>>   image: "myregistry:5000/jenkins-worker:latest",
>>>>   envVars:[
>>>> containerEnvVar( key: "PGUSER", value: "pguser" ),
>>>> containerEnvVar( key: "PGPASSWORD", value: "pgpassword" )
>>>>   ],
>>>>   alwaysPullImage: true,
>>>>   ttyEnabled: true,
>>>>   command: "cat"
>>>> )
>>>>   ]
>>>> )
>>>> {
>>>> node( "pod" ) {
>>>>
>>>>   container( "*worker*" ) {
>>>>
>>>> stage( "DB Tests" ) {
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *  containers: [containerTemplate(  name:
>>>> "db",  image: "myregistry:5000/postgresql-server:1.0",
>>>> alwaysPullImage: true,  ttyEnabled: true)  ]*
>>>>
>>>>   container( "*db*" ) {
>>>> sh "psql --host=127.0.0.1 --dbname=$project --echo-all
>>>> --command='SELECT timestamp FROM info'"
>>>>   }
>>>> }
>>>>   }
>>>> }
>>>> }
>>>>
>>>> And I got the error message result below:
>>>>
>>>> *Waiting for container container [db] of pod [slave-87s57-3zc4x] to become 
>>>> ready.*
>>>>
>>>>
>>>> Do I make something wrong in script?
>>>> Or that need to be implemented by other form or syntax?
>>>>
>>>> Thanks very much.
>>>>
>>>> BR
>>>> Hong
>>>>
>>>> Am Freitag, 11. August 2017 14:57:50 UTC+2 schrieb Carlos Sanchez:
>>>>>
>>>>> Have you tried?
>>>>>
>>>>> On Fri, Aug 11, 2017, 12:14 WANG, YAN-HONG <allway...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hello all,
>>>>>>
>>>>>> I saw the tutorial with jenkins-kubernetes-plugin.
>>>>>> https://github.com/jenkinsci/kubernetes-plugin
>>>>>>
>>>>>> The examples of containerTemplate are all created in the *beginning *of
>>>>>> groovy file.
>>>>>> And the *image name with version number *are *fixed*, too.
>>>>>> Example like this below.
>>>>>>
>>>>>> containerTemplate(
>>>>>> name: 'maven',
>>>>>> image: 'maven:3.3.9-jd

Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-14 Thread Carlos Sanchez
you can't define containers outside podTemplate

On Fri, Aug 11, 2017 at 11:55 PM, YAN-HONG WANG <allways.w...@gmail.com>
wrote:

> Hello Carlos,
>
> I tried it already with all *plain hard code*. And insert in the
> execution of pipeline.
>
> Something like this below:
>
> podTemplate(
>
>   label: "pod",
>
>   containers: [
> containerTemplate(
>   name: "*worker*",
>   image: "myregistry:5000/jenkins-worker:latest",
>   envVars:[
> containerEnvVar( key: "PGUSER", value: "pguser" ),
> containerEnvVar( key: "PGPASSWORD", value: "pgpassword" )
>   ],
>   alwaysPullImage: true,
>   ttyEnabled: true,
>   command: "cat"
> )
>   ]
> )
> {
> node( "pod" ) {
>
>   container( "*worker*" ) {
>
> stage( "DB Tests" ) {
>
>
>
>
>
>
>
>
> *  containers: [containerTemplate(  name:
> "db",  image: "myregistry:5000/postgresql-server:1.0",
> alwaysPullImage: true,  ttyEnabled: true)  ]*
>
>   container( "*db*" ) {
> sh "psql --host=127.0.0.1 --dbname=$project --echo-all
> --command='SELECT timestamp FROM info'"
>   }
> }
>   }
> }
> }
>
> And I got the error message result below:
>
> *Waiting for container container [db] of pod [slave-87s57-3zc4x] to become 
> ready.*
>
>
> Do I make something wrong in script?
> Or that need to be implemented by other form or syntax?
>
> Thanks very much.
>
> BR
> Hong
>
> Am Freitag, 11. August 2017 14:57:50 UTC+2 schrieb Carlos Sanchez:
>>
>> Have you tried?
>>
>> On Fri, Aug 11, 2017, 12:14 WANG, YAN-HONG <allway...@gmail.com> wrote:
>>
>>> Hello all,
>>>
>>> I saw the tutorial with jenkins-kubernetes-plugin.
>>> https://github.com/jenkinsci/kubernetes-plugin
>>>
>>> The examples of containerTemplate are all created in the *beginning *of
>>> groovy file.
>>> And the *image name with version number *are *fixed*, too.
>>> Example like this below.
>>>
>>> containerTemplate(
>>> name: 'maven',
>>> image: 'maven:3.3.9-jdk-8-alpine',
>>> ttyEnabled: true,
>>> command: 'cat'
>>> )
>>>
>>> Is that possible or some *syntax *can implement container created
>>> during *execution of pipeline*?
>>> So this container could also run in *the same Pod*.
>>> Maybe the syntax looks like below.
>>>
>>> //
>>>
>>> ..
>>> ..
>>>
>>> containerTemplate(
>>> name: 'maven',
>>> image: 'myregistry:5000/*$ImageName*:*$VersionNumber*',
>>> ttyEnabled: true,
>>> command: 'cat'
>>> )
>>>
>>> ..
>>> ..
>>>
>>> //
>>>
>>> Thanks very much.
>>>
>>> BR
>>> Hong
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/CADLWyO3katWvkMezE80XJ8u%3DFna_QW5%
>>> 2BjWT12PYa%3Dar_BUgAxQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/CADLWyO3katWvkMezE80XJ8u%3DFna_QW5%2BjWT12PYa%3Dar_BUgAxQ%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/6d679b02-1099-45a8-a35b-c89e25fae0a5%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/6d679b02-1099-45a8-a35b-c89e25fae0a5%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/CALHFn6Mohh7jSYwQ6_ke7DrZomJ9hpxrtSqfuLoKTh5tNG0Whw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Image name and version of containerTemplate by variable created during execution of pipeline?

2017-08-11 Thread Carlos Sanchez
Have you tried?

On Fri, Aug 11, 2017, 12:14 WANG, YAN-HONG  wrote:

> Hello all,
>
> I saw the tutorial with jenkins-kubernetes-plugin.
> https://github.com/jenkinsci/kubernetes-plugin
>
> The examples of containerTemplate are all created in the *beginning *of
> groovy file.
> And the *image name with version number *are *fixed*, too.
> Example like this below.
>
> containerTemplate(
> name: 'maven',
> image: 'maven:3.3.9-jdk-8-alpine',
> ttyEnabled: true,
> command: 'cat'
> )
>
> Is that possible or some *syntax *can implement container created during 
> *execution
> of pipeline*?
> So this container could also run in *the same Pod*.
> Maybe the syntax looks like below.
>
> //
>
> ..
> ..
>
> containerTemplate(
> name: 'maven',
> image: 'myregistry:5000/*$ImageName*:*$VersionNumber*',
> ttyEnabled: true,
> command: 'cat'
> )
>
> ..
> ..
>
> //
>
> Thanks very much.
>
> BR
> Hong
>
> --
> 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/CADLWyO3katWvkMezE80XJ8u%3DFna_QW5%2BjWT12PYa%3Dar_BUgAxQ%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/CALHFn6P8rJ2kLDRQMaqugKeuPJSkeFR6Uyrpac%3Diz7h3bS6%3DPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2017-08-11 Thread Carlos Sanchez
I'm not familiar with declarative pipeline, but looking at what Andrew did
in KubernetesDeclarativeAgent.java
<https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesDeclarativeAgent.java>
I
assume you need to add the pod template fields that you need in there.
envVars, volumes,...

On Thu, Aug 10, 2017 at 12:03 PM, Vincent Heet <vincenth...@gmail.com>
wrote:

> Ok so maybe i'm able to add this myself next week. I looked at the class
> you mentioned but would adding the PodTemplate class as a property there
> fix my issue? And I'm not sure why you mention volumes, volumes would then
> be supported from the PodTemplate if I understand this correctly?
>
>
> On Thursday, August 10, 2017 at 10:27:14 AM UTC+2, Carlos Sanchez wrote:
>>
>> It is not yet possible. Volumes would need to be added to the class
>> https://github.com/jenkinsci/kubernetes-plugin/blob/
>> master/src/main/java/org/csanchez/jenkins/plugins/kubernetes
>> /pipeline/KubernetesDeclarativeAgent.java
>>
>> On Thu, Aug 10, 2017 at 9:22 AM, Vincent Heet <vince...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I configured a declarative pipeline with the kubernetes-plugin to start
>>> a jenkins job's in a k8s cluster. This is working great but now I want to
>>> use volumes for secrets and need to specify a podTemplate. I'm not sure how
>>> to configure a podTemplate for a declarative pipeline. The pipeline that is
>>> working:
>>>
>>>
>>> pipeline {
>>> agent {
>>> kubernetes {
>>> label 'jenkins-demo'
>>> containerTemplate {
>>> name 'dind-jdk8-maven3'
>>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
>>> ttyEnabled true
>>> command 'cat'
>>> }
>>> }
>>> }
>>> stages {
>>> }
>>> }
>>>
>>>
>>> The above I would like to extend with a podTemplate containing volumes
>>> and a secretVolume. The issue is that I don't know the correct syntax for
>>> specifying a podTemplate in the declarative pipeline. So I came up with
>>> this:
>>>
>>>
>>> pipeline {
>>> agent {
>>> kubernetes {
>>> label 'jenkins-demo'
>>> podTemplate {
>>> volumes {
>>> secretVolume(secretName: 'some-secret', mountPath:
>>> '/some-secret')
>>> }
>>> containerTemplate {
>>> name 'dind-jdk8-maven3'
>>> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
>>> ttyEnabled true
>>> command 'cat'
>>> }
>>> }
>>> }
>>> }
>>> stages {
>>> }
>>> }
>>>
>>>
>>> Ofcourse this doesn't work an throws an error. Can anyone help me out
>>> with specifying a podTemplate so I can use k8s secrets?
>>>
>>> Thanks,
>>> Vincent
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%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/4fed7d43-bbbc-46ab-a718-5e7f6e5d2a99%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/4fed7d43-bbbc-46ab-a718-5e7f6e5d2a99%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/CALHFn6MaKM1wk6diEpczpK1Vc2pDACc_AW0J3rxKJt0-u00pAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Secrets as "environment variables" in containerTemplate of jenkins-kubernetes-plugin

2017-08-10 Thread Carlos Sanchez
There is a PR for it https://github.com/jenkinsci/kubernetes-plugin/pull/162

On Thu, Aug 10, 2017 at 9:15 PM, YAN-HONG WANG 
wrote:

> Hi,
>
> In jenkins-kubernetes-plugin, is there any syntax that support using *Secrets
> as environment variables* in *containerTemplate*?
>
> I just saw something from here.
> https://kubernetes.io/docs/concepts/configuration/secret/
> #using-secrets-as-environment-variables
>
> So some syntax like "*secretKeyRef*" could be indicated in
> *containerTemplate?*
>
> apiVersion: v1kind: Podmetadata:
>   name: secret-env-podspec:
>   containers:
> - name: mycontainer
>   image: redis
>   env:
> - name: SECRET_USERNAME
>   valueFrom:
> secretKeyRef:
>   name: mysecret
>   key: username
> - name: SECRET_PASSWORD
>   valueFrom:
> secretKeyRef:
>   name: mysecret
>   key: password
>   restartPolicy: Never
>
> Thanks.
>
> Best regards,
> Hong
>
> --
> 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/a4be1cee-cfd4-48d8-a97e-fa5c30d95ce6%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/CALHFn6Mht9PHnX7WNFMranPz-J6VvPaQkrx8ci_pDBQ1dGQXcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: The format of key of containerEnvVar within Jenkins Kubernetes Plugin

2017-08-10 Thread Carlos Sanchez
You can not use dots in an environment variable

https://kubernetes.io/docs/api-reference/v1.6/#envvar-v1-core


a valid C identifier must start with alphabetic character or '_',
followed by a string of alphanumeric characters or '_'



On Wed, Aug 9, 2017 at 9:18 AM, WANG, YAN-HONG 
wrote:

> Hello,
>
> I am Hong.
>
> I saw "*containerEnvVar*" was supported by Jenkins *Kubernetes* Plugin
> 0.9.
> But, it seems not support some key value with *dot*?
>
> Example in *containerTemplate*:
> *containerEnvVar*( key: “*data.source.url*”, value: “somewhere” )
>
> I tried to use *backslash *to escape *dot*, but Jenkins parser doesn't
> pass it.
>
> Someone has idea?
>
> Thanks very much.
>
> Best regards,
> Hong
>
> --
> 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/ms
> gid/jenkinsci-users/CADLWyO1jrOYcJzMgBFZvMy0uENVjMORJsrSr%
> 3DUoi%2Bf%2B-jGP-dg%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/CALHFn6MJxsBOT6_FOn1nyQr%3DNo18SX_bFng_KrWCpzUEn3jwdw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use podTemplate in a declarative pipeline with the kubernetes-plugin.

2017-08-10 Thread Carlos Sanchez
It is not yet possible. Volumes would need to be added to the class
https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/KubernetesDeclarativeAgent.java

On Thu, Aug 10, 2017 at 9:22 AM, Vincent Heet  wrote:

> Hi,
>
> I configured a declarative pipeline with the kubernetes-plugin to start a
> jenkins job's in a k8s cluster. This is working great but now I want to use
> volumes for secrets and need to specify a podTemplate. I'm not sure how to
> configure a podTemplate for a declarative pipeline. The pipeline that is
> working:
>
>
> pipeline {
> agent {
> kubernetes {
> label 'jenkins-demo'
> containerTemplate {
> name 'dind-jdk8-maven3'
> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
> ttyEnabled true
> command 'cat'
> }
> }
> }
> stages {
> }
> }
>
>
> The above I would like to extend with a podTemplate containing volumes and
> a secretVolume. The issue is that I don't know the correct syntax for
> specifying a podTemplate in the declarative pipeline. So I came up with
> this:
>
>
> pipeline {
> agent {
> kubernetes {
> label 'jenkins-demo'
> podTemplate {
> volumes {
> secretVolume(secretName: 'some-secret', mountPath:
> '/some-secret')
> }
> containerTemplate {
> name 'dind-jdk8-maven3'
> image 'eu.gcr.io/jenkins-demo/dind-jdk8-maven3:v4'
> ttyEnabled true
> command 'cat'
> }
> }
> }
> }
> stages {
> }
> }
>
>
> Ofcourse this doesn't work an throws an error. Can anyone help me out with
> specifying a podTemplate so I can use k8s secrets?
>
> Thanks,
> Vincent
>
> --
> 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/a69efdfc-7c1c-4e4f-a909-0b43ad95868b%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/CALHFn6PZQNMYN3FWH9i9OkMGWrTaeR6L6oHrMe7OoQ60v1QhSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: podTemplate with GKE

2017-05-24 Thread Carlos Sanchez
First, what does it mean "it doesn't work"? Have you checked the Jenkins
logs?

You can find examples at https://github.com/jenkinsci/kubernetes-plugin

On Wed, May 24, 2017, 09:39 Philippe Fuentes 
wrote:

> Hi everybody,
> I've been strugleling for a while trying to add an additional podTemplate
> to the default one offered by this nice google installation tutorial:
>
> https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes
>
> started by trying to make the docker plugin work:
>
> https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/65
>
> then went to the kubernetes plugin road by trying to add an additional
> podTemplate:
>
> https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/issues/75
>
> tried many things, no success, the whole point is to be able to switch
> between several configuration based on all ready gcloud/kubectl images:
>
> https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes/blob/master/jenkins/docker-slave-image/Dockerfile
>
> with different configuration for each (like adding nodejs etc...)
> depending on the need of my services.
>
>
> but only the default podTemplate is working for me, can't seem to add
> another, either with podTemplate on jenkinsfile or via the kubernete plugin
> configuration (showed in the screenshot attached).
>
> quite new to Jenkins/Kubernetes/Docker, don't know what I'm missing...
>
>
> Thanks in advance for your help and for taking the time.
> Philippe
>
>
>
>
>
> --
> 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/299315b6-546a-4bce-ac72-c95469ff7ece%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/CALHFn6OuEkxL%2By-E9Y6rK-_hJ%2BrFfbaHdTByGJdZ2kj2MLXBXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: when will the docker jenkins be at LTS version?

2017-04-03 Thread Carlos Sanchez
"jenkins" image is published by Docker team on our request, and it takes 
them some time
See https://github.com/jenkinsci/docker/pull/454

You are better today using jenkinsci/jenkins:lts that is automatically 
built and published


On Monday, April 3, 2017 at 6:14:56 PM UTC+2, Mark Waite wrote:
>
> I think I've understood the steps you're using.  I suspect you pulled the 
> official image from Docker as:
>
> docker pull jenkins
> docker run --rm -i --publish 8080:8080 jenkins:latest
>
> That seems perfectly reasonable to me, and I confirmed that (as you said) 
> it is running Jenkins 2.32.3.
>
> I believe Carlos Sanchez (and others) control the publishing of official 
> images to that location, but I'm not 100% sure of that.  The 2.32.3 image 
> was pushed to that location only 3 days ago, so I'm not sure of the general 
> plan for delivering new LTS releases to the official Docker image.
>
> Mark Waite
>
> On Mon, Apr 3, 2017 at 10:01 AM Mark Waite <mark.ea...@gmail.com 
> > wrote:
>
>> The Dockerfile was updated to 2.46.1 a few days ago.
>>
>> I ran:
>>
>> docker pull jenkinsci/jenkins:lts
>> docker run --rm -i --publish 8080:8080 jenkinsci/jenkins:lts
>>
>> and was able to confirm that it is running 2.46.1 for me.
>>
>> Can you provide more description of the steps you're using?
>>
>> Mark Waite
>>
>>
>> On Mon, Apr 3, 2017 at 9:40 AM Marlene Cote <funee...@gmail.com 
>> > wrote:
>>
>>> The LTS version of Jenkins is 2.46.1, but the docker version is 2.32.3.
>>> When will 2.46.1 be available from docker, please?
>>> thanks,
>>> Marlene
>>>
>>> -- 
>>> 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/6e97221a-a103-478e-bb67-cfd5a8c15ba0%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/6e97221a-a103-478e-bb67-cfd5a8c15ba0%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/4dbb154f-f413-4c96-a7ba-669b9b04ab7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: kubernetes-plugin: containertemplate with shell-script in entrypoint

2017-03-17 Thread Carlos Sanchez
On Fri, Mar 17, 2017 at 12:40 PM, 'Sascha Vujevic' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Hello developers,
>
> i don't know if i use the kubernetes-plugin correct:
> My jenkinsfile looks like:
>
> podTemplate(label: 'mypod', containers: [
> containerTemplate(name: 'maven', image: 'myOwnMavenImage:latest'',
> ttyEnabled: true, command: 'cat')
>   ]) {
>
> node ('mypod') {
> stage 'Get a Maven project'
> git 'https://github.com/jenkinsci/kubernetes-plugin.git'
> container('maven') {
> stage 'Build a Maven project'
> sh 'mvn clean install'
> }
> }
> }
>
>
> My Dockerfile uses a script-file as entrypoint:
>
>
> *run-script:*
>
>
> export JENKINS_HOME=/var/lib/jenkins
>
> # Setup nss_wrapper so the random user OpenShift will run this container
> # has an entry in /etc/passwd.
> # This is needed for 'git' and other tools to work properly.
> #
> export USER_ID=$(id -u)
> export GROUP_ID=$(id -g)
> envsubst < ${JENKINS_HOME}/passwd.template > ${JENKINS_HOME}/passwd
> export LD_PRELOAD=libnss_wrapper.so
> export NSS_WRAPPER_PASSWD=${JENKINS_HOME}/passwd
> export NSS_WRAPPER_GROUP=/etc/group
>
> exec "$@"
>
>
> *dockerfile:*
>
>
> FROM openjdk8:stable
>
> ENV MAVEN_HOME /usr/share/maven
> ENV M2_HOME /usr/share/maven
> ENV JENKINS_HOME=/var/lib/jenkins
>
> COPY ./contrib/.m2 $JENKINS_HOME/.m2/
> COPY ./contrib/maven $M2_HOME
> COPY ./contrib/fix-permissions /usr/local/bin/fix-permissions
> COPY ./contrib/passwd.template $JENKINS_HOME/passwd.template
> COPY ./contrib/run /var/lib/jenkins/run
>
> USER root
>
> RUN yum-config-manager --disable epel >/dev/null || : && \
> yum-config-manager --enable rhel-7-server-ose-3.3-rpms || : && \
> INSTALL_PKGS="nss_wrapper gettext git lsof rsync tar unzip which zip"
> && \
> yum install -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
> rpm -V $INSTALL_PKGS && \
> yum clean all
>
> RUNlocaledef -f UTF-8 -i en_US en_US.UTF-8
> RUNln -s $M2_HOME/bin/mvn /usr/bin/mvn
> RUNchmod a+x /usr/local/bin/fix-permissions
> RUNchown -R 1001:0 $M2_HOME
> RUNchmod 775 $M2_HOME/bin/*
> RUN/usr/local/bin/fix-permissions $M2_HOME/bin
>
> RUN chown -R 1001:0 $JENKINS_HOME && \
> chmod -R g+rw $JENKINS_HOME
>
> USER 1001
>
> ENTRYPOINT ["/var/lib/jenkins/run"]
>
> If i start the jenkins-job the pod is started with the jnlp- and the
> maven-container, but my shellscript in the maven-container is not used. I
> think thats because i use a cmd in the containertemplate of the
> maven-container.
>
>
> If i delete the cmd an set tty to 'false' the shellskript is used but the
> container stops after executing the shell-skript in the maven-container.
>
>
> Is there a posibility to have a long-running process in a container with
> executing a shell-script in the entrypoint of a container ?
>

yes, don't use 'cmd' in the pod template so your entrypoint is executed.
Your entrypoint has to be long-running, the container needs to be running
all time until pod is killed

>
> Thank you for your 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/7f2d3e30-0409-4ddc-a8a5-159987246b16%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/CALHFn6NQNmzUVJOVzEFf-B9qUmmde9mE4HKp_JhHqy00rhHm6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: docker swarm mode + pipeline deploy

2017-02-16 Thread Carlos Sanchez
There is no support yet for swarm mode AFAIK

On Thu, Feb 16, 2017 at 10:06 AM, Denis J. Cirulis 
wrote:

> Hello,
>
> wanted to ask for help with creating docker service from pipeline. For now
> I'm running my app stack from compose file on a single node.
> Created a swarm cluster (1.13.1) and wondering how can I create each
> component of this compose file as a standalone service from pipeline.
> When I do withDockerServer() block I'm connecting to docker daemon, but
> not to swarm manager I suppose and can start just an ordinary container not
> a service.
>
> Is there a way to launch a service or maybe some different technique to
> achieve results or maybe should I switch to different clustering mode
> (kubernetes / mesos) ?
>
> 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/421a2a80-1b3c-4331-a676-fd152d298978%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/CALHFn6PLV8bnOWFLZ6STeqH%3DKvEtm3iexiu55N2HKkgD7U%3DAFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Example of a working pod with the kubernetes-ci plugin

2017-02-10 Thread Carlos Sanchez


On Saturday, January 28, 2017 at 6:36:55 PM UTC+1, Joe Rhaman wrote:
>
> Carlos,
>
> This Plugin clearly doesn't work Please provide a detailed how to at 
> least rather on how this works.
>
> This is turning out to be a complete waste of time. 
>


Considering that are over 1200 installations, I think it is safe to assume 
that it does work for most people.
There are examples at https://github.com/jenkinsci/kubernetes-plugin

As I mentioned in the previous mail, in order to see why pods can't connect 
to jenkins you need to get the pod logs in Kubernetes side: kubectl logs 
pods/{your pod id} jnlp
 

>
> Joe
>
> On Monday, December 19, 2016 at 7:44:43 AM UTC, Carlos Sanchez wrote:
>>
>>
>>
>> On Tue, Dec 6, 2016, 22:37 Daniel Serodio <dser...@gmail.com> wrote:
>>
>>> Hi Carlos,
>>>
>>> I'm trying to understand how composing multiple containers (one with the 
>>> JNLP slave, another with Maven) in a Pod Template but I can't get the 
>>> example pipeline to work. The Jenkins logs show that it's "Waiting for 
>>> slave to connect", and after 100 tries it gives up, deletes the Pod and 
>>> creates a new one ad infinitum.
>>>
>>> Using "kubectl get pods" I can see that the 2 containers have been 
>>> created and the Pod is running, but it won't connect to the Jenkins master.
>>>
>>
>> You need to get the pod logs to see why it is not connecting. kubectl 
>> logs pods/... jnlp
>>
>>
>>> The example pipeline uses a maven and a golang images, but none of them 
>>> knows how to connect to Jenkins using JNLP. The README says that "The jnlp 
>>> agent image used can be customized by adding it to the template", but it 
>>> seems that I need to include a JNLP image in the pod template so that it 
>>> can talk to Jenkins.
>>>
>>>
>>> On Wednesday, November 23, 2016 at 7:12:24 PM UTC-2, Carlos Sanchez 
>>> wrote:
>>>>
>>>> You can't just jump from a container to another,  can only share 
>>>> through network or shared filesystem.
>>>> http://kubernetes.io/docs/user-guide/pods/
>>>>
>>>> I suggest using the Kubernetes Jenkins plugin that can do exactly what 
>>>> you want using pipeline
>>>>
>>>> https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pipeline-support
>>>>
>>> -- 
>>> 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/khpG2-6NBNI/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/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%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/fa355e11-ec8d-4d75-8fb6-145bb710de31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retain kubernetes jenkins slave for whole pipeline

2017-01-30 Thread Carlos Sanchez
then just create one pipeline that does everything, or pass as a parameter
the commit id (GIT_COMMIT) of what you are building, so it's always the same


On Tue, Jan 31, 2017 at 8:36 AM, Prashant Sharma <prashant.de...@gmail.com>
wrote:

> Hi Carlos,
>
> Thanks for answer!
>
> I dont want to checkout source code at every stage bcoz, while the time
> pipeline is running, if anyone checks in any code, so next job in pipeline
> will take latest source code. rather previous jobs ran with old source
> code. which ultimately fails the goal of CI pipeline.
>
> On Tuesday, 31 January 2017 12:39:12 UTC+5:30, Carlos Sanchez wrote:
>>
>>
>>
>> On Tue, Jan 31, 2017 at 7:59 AM, Prashant Sharma <prashan...@gmail.com>
>> wrote:
>>
>>> Hi team,
>>>
>>> In my scenario, I am running a ci pipeline of java project whose
>>> jenkinsfile look like below:
>>>
>>> node ('slave_java') {
>>>
>>> stage "checkout code"
>>> build "fetch-code"
>>>
>>> stage "compile code"
>>> build "code-stability"
>>>
>>> stage "code-quality"
>>> parallel "code-quality": {
>>> build "code-quality"
>>> }, "code-coverage": {
>>> build "code-coverage"
>>> }
>>>
>>>
>>> 1)fetch-code,code-stability,code-quality,code-coverage these jobs are
>>> pre-existing.and these jobs use a common workspace (configured in jobs)
>>> 2)as pipeline job starts it creates a kubernetes slave for fetch-code
>>> job, and job runs and slave dies.
>>> 3)when next job code-stability executes, it creates new fresh kubernetes
>>> slave for this, and as there is no source code ,compilation failes.
>>>
>>> possible solution may be to checkout source code in every stage, but i
>>> dont want this.another solution is ruuning shell commnads(sh mvn clean
>>> install) in every stage instead of build job. but i want to use jobs only.
>>>
>>>
>>> is there any way by which we can *retain 1 kubernetes slave* for all
>>> following jobs?
>>>
>>
>>
>> Not that I know of, but not only for kubernetes, but for any cloud,
>> because basically each job or node{} is requesting a new slave.
>>
>> But I don't understand why you want to do that, if you are calling jobs
>> is because those jobs have some value as independent jobs. Then they need
>> to checkout the code, otherwise you wouldn't be able to call them separately
>>
>> You may get the same slave if you increase the retention timeout so the
>> slave stays around after a build, but it is not guaranteed
>>
>>
>>
>>>
>>> --
>>> 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/ms
>>> gid/jenkinsci-users/597147e2-af80-4d92-8376-928409a354a4%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/597147e2-af80-4d92-8376-928409a354a4%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/fc27cecb-e838-4e4e-918b-57df99b33a7d%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/fc27cecb-e838-4e4e-918b-57df99b33a7d%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/CALHFn6OvSWbN8WCZnCXg1YDCGL5ePFB55HA5ye6y6mGJeGYy7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Retain kubernetes jenkins slave for whole pipeline

2017-01-30 Thread Carlos Sanchez
On Tue, Jan 31, 2017 at 7:59 AM, Prashant Sharma 
wrote:

> Hi team,
>
> In my scenario, I am running a ci pipeline of java project whose
> jenkinsfile look like below:
>
> node ('slave_java') {
>
> stage "checkout code"
> build "fetch-code"
>
> stage "compile code"
> build "code-stability"
>
> stage "code-quality"
> parallel "code-quality": {
> build "code-quality"
> }, "code-coverage": {
> build "code-coverage"
> }
>
>
> 1)fetch-code,code-stability,code-quality,code-coverage these jobs are
> pre-existing.and these jobs use a common workspace (configured in jobs)
> 2)as pipeline job starts it creates a kubernetes slave for fetch-code job,
> and job runs and slave dies.
> 3)when next job code-stability executes, it creates new fresh kubernetes
> slave for this, and as there is no source code ,compilation failes.
>
> possible solution may be to checkout source code in every stage, but i
> dont want this.another solution is ruuning shell commnads(sh mvn clean
> install) in every stage instead of build job. but i want to use jobs only.
>
>
> is there any way by which we can *retain 1 kubernetes slave* for all
> following jobs?
>


Not that I know of, but not only for kubernetes, but for any cloud, because
basically each job or node{} is requesting a new slave.

But I don't understand why you want to do that, if you are calling jobs is
because those jobs have some value as independent jobs. Then they need to
checkout the code, otherwise you wouldn't be able to call them separately

You may get the same slave if you increase the retention timeout so the
slave stays around after a build, but it is not guaranteed



>
> --
> 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/597147e2-af80-4d92-8376-928409a354a4%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/CALHFn6P9TY80PGHTQ3LuTEzcrhXpQgujhcM3GYEoGOvcLh3Y6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >