Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46363

Slave pod using global pod definition end up with error state

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      If we use a global pod (defined within the configure Jenkins panel).

      The pod will end up in a «Error» state with the jnlp in error and the others container within still running.

      So this easy example:

       

      node("slave-go"){
        sleep 5
      }

       

      Where «slave-go» is a pod with 2 containers, a go container and a jnlp container.

      The job will run with a success state, but the pod will fall in a Error state.

       

      slave-go-2jl94             1/2       Error     0          6h
      

      The log of the jnlp container seem to properly end:

      ...
      Aug 22, 2017 8:30:10 PM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Terminated
      

      But will immediately try to reconnect:

      ...
      Aug 22, 2017 8:30:20 PM jenkins.slaves.restarter.JnlpSlaveRestarterInstaller$2$1 onReconnect
      INFO: Restarting agent via jenkins.slaves.restarter.UnixSlaveRestarter@22f325f7
      Aug 22, 2017 8:30:21 PM hudson.remoting.jnlp.Main createEngine
      ...

      It will try all the protocols and than fail.

       

      This is where is it interesting. If we use a podTemplate defintion, instead of a global pod definition. We will end up with a job running with sucess and a slave pod going to the proper «terminating» state.

      So this example will work:

      podTemplate(label: 'example_go', inheritFrom: 'slavenode',
        containers: [
          containerTemplate(name: 'golang',
          image: 'somegoimage',
          ttyEnabled: true,
          alwaysPullImage: true,
          workingDir: '/home/jenkins/workspace',
          command: 'cat')
        ]) {
      node("example_go"){
        container("golang"){
          sleep 5 
        }
       }
      }
      

      Please fix it, so that slave provided by a standard global pod definition end up in the proper state.

      This was properly working with version 0.10 of the kubernetes plugin.

       

        Attachments

          Issue Links

            Activity

            Hide
            pascallap Pascal Laporte added a comment -

            Still even with a the workaround of feeding namespace on each pod template.

            The «main» namespace should be by default the one on each pod template.

            Show
            pascallap Pascal Laporte added a comment - Still even with a the workaround of feeding namespace on each pod template. The «main» namespace should be by default the one on each pod template.

              People

              Assignee:
              csanchez Carlos Sanchez
              Reporter:
              pascallap Pascal Laporte
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: