[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan commented on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error Aleksejs Cibinogins - please see the comment above for the code snippet in context: I refer to the container step as follows, where each container (step) needs to be bound to the cloud. the full snippet is posted above. the NPE is very likely because the containerstep (https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerStepExecution.java#L51) the KubernetesCloud object is initialized from the ContainerStep's cloud name. Please let me know if this is unclear and i will add more. container(name:'golang', cloud:'minikube') { stage 'Build a Go project' sh """ mkdir -p /go/src/github.com/golang/ ln -s `pwd` /go/src/github.com/golang/example export GOPATH=/go cd /go/src/github.com/golang/example/hello && go build """ } Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan commented on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error the fix works as advertised. i dont see the original issue anymore. however, a couple of observations - please validate: 1. now each container step is required to declare which cloud it needs to be launched in. would be great to have this inherit this info from the pod template, but seems like the design challenge is each pod templates can be inherited and each pod template can bind to a cloud, we cant derive the intent clean. 2. if the containerstep fails to declare the cloud, that results in a null pointer exception, we may need to handle it in a clean way. test snippet below for reference (modified slightly from the original for build time): Note: 1. that my jenkins instance runs from docker swarm , where as the slave workloads are scheduled on minikube 2. built with latest from master (0.10-SNAPSHOT) podTemplate( cloud: 'minikube', label: 'docker', containers: [ //containerTemplate(name: 'jnlp', image: 'jenkinsci/jnlp-slave:2.62-alpine', args: '${computer.jnlpmac} ${computer.name}'), containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat'), containerTemplate(name: 'golang', image: 'golang:1.6.3-alpine', ttyEnabled: true, command: 'cat') ], volumes: [secretVolume(secretName: 'shared-secret', mountPath: '/etc/shared-secrets')], ) { node ('docker') { stage 'Get a Maven project' git 'https://github.com/pgrimard/spring-boot-hello-world.git' container(name:'maven', cloud:'minikube') { stage 'Build a Maven project' try { sh 'mvn clean install' }catch (Exception ex) { ex.printStackTrace() } } stage 'Get a Golang project' git url: 'https://github.com/golang/example.git' container(name:'golang', cloud:'minikube') { stage 'Build a Go project' sh """ mkdir -p /go/src/github.com/golang/ ln -s `pwd` /go/src/github.com/golang/example export GOPATH=/go cd /go/src/github.com/golang/example/hello && go build """ } } } Add Comment
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan edited a comment on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error Thanks [~iocanel] . That was super fast. Appreciate the quick turn around.Can you point out where the fix is ? seems like it is in the kubernetes-plugin? if it is in a branch , I would be happy to test it out. I looked at the commit histories , but couldnt locate seems like this is the fix branch one . {code} https://github.com/jenkinsci/kubernetes-plugin/commit/2be70ba43db9c00ab872e8d2c1eac7db27f084e0{code} Thanksprabhu Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan commented on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error Thanks Ioannis Canellos . That was super fast. Appreciate the quick turn around. Can you point out where the fix is ? seems like it is in the kubernetes-plugin? if it is in a branch , I would be happy to test it out. I looked at the commit histories , but couldnt locate the fix branch. Thanks prabhu Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan edited a comment on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error [~iocanel] - Can you please clarify the comment , my setup is somewhat similar. I am running my jenkins master in docker swarm, but have configured it to run my slave workloads on remote kubernetes.i have looked at the kubernetes-plugin code somewhat superficially , but dont see how the stack trace above correlates with any logic from the kubernetes-client plugin. Interestingly enough, this problem seems to impact all the shell commands in pipeline DSL , the other jvm calls seems okay.{code:java}https://github.com/jenkinsci/kubernetes-plugin/blob/52c0af572ef091399fa76657be34471c033d1464/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecDecorator.java#L92{code}" if you use the kubernetes-plugin outside of kubernetes, you need to properlly configure it to talk to the remote kubernetes." what configuration are you referring to (or) perhaps you are referring to the usage of the kubernetes-client within the kubernetes-plugin ? i tried setting the kubernetes_master (env) or kubernetes.master (system property) for jenkins master - but there is no change to the behavior Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan edited a comment on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error [~iocanel] - Can you please clarify the comment , my setup is somewhat similar. I am running my jenkins master in docker swarm, but have configured it to run my slave workloads on remote kubernetes.i have looked at the kubernetes-plugin code somewhat superficially , but dont see how the stack trace above correlates with any logic from the kubernetes-client plugin. Interestingly enough, this problem seems to impact all the shell commands in pipeline DSL , the other jvm calls seems okay. {code:java}https://github.com/jenkinsci/kubernetes-plugin/blob/52c0af572ef091399fa76657be34471c033d1464/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecDecorator.java#L92{code} " if you use the kubernetes-plugin outside of kubernetes, you need to properlly configure it to talk to the remote kubernetes." what configuration are you referring to? Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-39695) Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error
Title: Message Title Prabhu Inbarajan commented on JENKINS-39695 Re: Shell stop in a pipeline job: Java.net.UnknownHostException: kubernetes.default.svc: unknown error Ioannis Canellos - Can you please clarify the comment , my setup is somewhat similar. I am running my jenkins master in docker swarm, but have configured it to run my slave workloads on remote kubernetes. i have looked at the kubernetes-plugin code somewhat superficially , but dont see how the stack trace above correlates with any logic from the kubernetes-client plugin. Interestingly enough, this problem seems to impact all the shell commands in pipeline DSL , the other jvm calls seems okay. " if you use the kubernetes-plugin outside of kubernetes, you need to properlly configure it to talk to the remote kubernetes." what configuration are you referring to? Add Comment This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.