Example of a working pod with the kubernetes-ci plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Example of a working pod with the kubernetes-ci plugin

Sébastien Douche
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 <[hidden email]>
Twitter: @sdouche
http://douche.name

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1479717781.3245735.794287233.6859EEAF%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Example of a working pod with the kubernetes-ci plugin

Carlos Sanchez
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 the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0dd10c35-3b03-40e5-b414-5c1f9069821b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Sébastien Douche
On Wed, Nov 23, 2016, at 22:12, Carlos Sanchez wrote:

Hi Carlos

> 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

Doesn't work for me:
https://issues.jenkins-ci.org/browse/JENKINS-39695


--
Sébastien Douche <[hidden email]>
Twitter: @sdouche
http://douche.name

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1480001989.3187294.798168681.3C00865C%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Daniel Serodio
In reply to this post by Carlos Sanchez
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.

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.
<a href="http://kubernetes.io/docs/user-guide/pods/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;">http://kubernetes.io/docs/user-guide/pods/

I suggest using the Kubernetes Jenkins plugin that can do exactly what you want using pipeline
<a href="https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pipeline-support" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;">https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pipeline-support

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Carlos Sanchez


On Tue, Dec 6, 2016, 22:37 Daniel Serodio <[hidden email]> 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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CALHFn6NPFoFa1MfNE35Pi72C%2Bk7pjgsWVuW4aWKF91MfeRAU9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

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

Joe

On Monday, December 19, 2016 at 7:44:43 AM UTC, Carlos Sanchez wrote:


On Tue, Dec 6, 2016, 22:37 Daniel Serodio <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="r-b1Pt8lAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">dser...@...> 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.
<a href="http://kubernetes.io/docs/user-guide/pods/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;">http://kubernetes.io/docs/user-guide/pods/

I suggest using the Kubernetes Jenkins plugin that can do exactly what you want using pipeline
<a href="https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pipeline-support" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe&#39;;return true;">https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="r-b1Pt8lAAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f551c818-89b7-4e9e-89e8-5432898637bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

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 <[hidden email]> 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.
<a href="http://kubernetes.io/docs/user-guide/pods/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fkubernetes.io%2Fdocs%2Fuser-guide%2Fpods%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHDSXaLvYmDq-LEHSIPPcawMIWmyw&#39;;return true;">http://kubernetes.io/docs/user-guide/pods/

I suggest using the Kubernetes Jenkins plugin that can do exactly what you want using pipeline
<a href="https://github.com/jenkinsci/kubernetes-plugin/blob/master/README.md#pipeline-support" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fjenkinsci%2Fkubernetes-plugin%2Fblob%2Fmaster%2FREADME.md%23pipeline-support\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFtYufT1VmHJtVbQpqPACJovwh_xg&#39;;return true;">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 <a href="https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/topic/jenkinsci-users/khpG2-6NBNI/unsubscribe&#39;;return true;">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 <a href="https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/9ff5076f-b06e-428f-a43e-5c9d2e4b0094%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

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

Vamsi krishna
In reply to this post by Sébastien Douche
@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: "<a href="https://XXX" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2FXXX\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLoG0-Vl_2ov3w66ksUzQLebZjoA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2FXXX\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLoG0-Vl_2ov3w66ksUzQLebZjoA&#39;;return true;">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 <a href="https://github.com/hashicorp/terraform.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0jkJhzIpbmL3dbCD7LzF6Q-ILXw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0jkJhzIpbmL3dbCD7LzF6Q-ILXw&#39;;return true;">https://github.com/hashicorp/terraform.git
mkdir -p /go/src/<a href="http://github.com/hashicorp" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH8ipWy5ft9YJ7HEHMiXR0ePk1K1g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH8ipWy5ft9YJ7HEHMiXR0ePk1K1g&#39;;return true;">github.com/hashicorp
ln -s `pwd` /go/src/<a href="http://github.com/hashicorp/terraform" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;">github.com/hashicorp/terraform
cd /go/src/<a href="http://github.com/hashicorp/terraform" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;">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 <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="VW9e7_VqCQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">s...@...>
Twitter: @sdouche
<a href="http://douche.name" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdouche.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFS1RzxNimtZSlJwo7GW7yHkPPonQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdouche.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFS1RzxNimtZSlJwo7GW7yHkPPonQ&#39;;return true;">http://douche.name

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6ab7ad20-7468-4695-8191-6560fda11d50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

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

Fadi Al-Farah
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: "<a href="https://XXX" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2FXXX\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLoG0-Vl_2ov3w66ksUzQLebZjoA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2FXXX\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHLoG0-Vl_2ov3w66ksUzQLebZjoA&#39;;return true;">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 <a href="https://github.com/hashicorp/terraform.git" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0jkJhzIpbmL3dbCD7LzF6Q-ILXw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH0jkJhzIpbmL3dbCD7LzF6Q-ILXw&#39;;return true;">https://github.com/hashicorp/terraform.git
mkdir -p /go/src/<a href="http://github.com/hashicorp" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH8ipWy5ft9YJ7HEHMiXR0ePk1K1g&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH8ipWy5ft9YJ7HEHMiXR0ePk1K1g&#39;;return true;">github.com/hashicorp
ln -s `pwd` /go/src/<a href="http://github.com/hashicorp/terraform" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;">github.com/hashicorp/terraform
cd /go/src/<a href="http://github.com/hashicorp/terraform" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fgithub.com%2Fhashicorp%2Fterraform\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGPxsn6Y3SOY1ElkuivEIXWVSPRiw&#39;;return true;">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 <[hidden email]>
Twitter: @sdouche
<a href="http://douche.name" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdouche.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFS1RzxNimtZSlJwo7GW7yHkPPonQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdouche.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFS1RzxNimtZSlJwo7GW7yHkPPonQ&#39;;return true;">http://douche.name

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

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

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 <[hidden email]> 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 <[hidden email]>
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 [hidden email].
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 [hidden email].
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.