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

Add a Declarative Agent extension to the Kubernetes plugin

    XMLWordPrintable

    Details

    • Similar Issues:

      Attachments

        Issue Links

          Activity

          Hide
          teju009 Pavan Tej Medapuram added a comment -

          Not sure if I made progress but now I see a different error with the following agent section on my Jenkinsfile:

            agent { kubernetes {
              cloud 'kubernetes'
              label 'test'
                containerTemplate {
                  name 'jnlp'
                  image 'some_image'
                  ttyEnabled true
                }
            }}
          
          

          The job keeps waiting for the container to be provisioned. On the jenkins logs, I see that it is retrying 100 times, trying to provision the jnlp image from the docker hub. Not sure why it is respecting the image I configured.

          Show
          teju009 Pavan Tej Medapuram added a comment - Not sure if I made progress but now I see a different error with the following agent section on my Jenkinsfile: agent { kubernetes { cloud 'kubernetes' label 'test' containerTemplate { name 'jnlp' image 'some_image' ttyEnabled true } }} The job keeps waiting for the container to be provisioned. On the jenkins logs, I see that it is retrying 100 times, trying to provision the jnlp image from the docker hub. Not sure why it is respecting the image I configured.
          Hide
          csanchez Carlos Sanchez added a comment -

          The declarative extension is not ready yet, that's why it is undocumented. There is a test for minikube, but other than that, not really tested

          Show
          csanchez Carlos Sanchez added a comment - The declarative extension is not ready yet, that's why it is undocumented. There is a test for minikube, but other than that, not really tested
          Hide
          csanchez Carlos Sanchez added a comment -

          I have verified that both the example at https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/declarative.groovy and this one work in a Jenkins 2.66 server with the latest master build of the plugin

            pipeline {
          
            agent { kubernetes {
              cloud 'kubernetes'
              label 'test'
                containerTemplate {
                  name 'jnlp'
                  image 'jenkinsci/jnlp-slave:2.62-alpine'
                  ttyEnabled true
                  args '${computer.jnlpmac} ${computer.name}'
                }
            }}
          
          
            stages {
              stage('Run maven') {
                steps {
                  sh 'hostname'
                }
              }
            }
          }
          
          

          I'm going to close this issue, if you have a specific problem please open a new one

          Show
          csanchez Carlos Sanchez added a comment - I have verified that both the example at https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/declarative.groovy and this one work in a Jenkins 2.66 server with the latest master build of the plugin pipeline { agent { kubernetes { cloud 'kubernetes' label 'test' containerTemplate { name 'jnlp' image 'jenkinsci/jnlp-slave:2.62-alpine' ttyEnabled true args '${computer.jnlpmac} ${computer.name}' } }} stages { stage( 'Run maven' ) { steps { sh 'hostname' } } } } I'm going to close this issue, if you have a specific problem please open a new one
          Hide
          fonsecas72 hugo fonseca added a comment -

          Hi, can someone tell me how can I setup volumes please? 

          Show
          fonsecas72 hugo fonseca added a comment - Hi, can someone tell me how can I setup volumes please? 
          Hide
          bd82 Shahar Soel added a comment - - edited

          I think this may be missing some functionality.

          It seems only one containerTemplate can possibly be defined using the declarative syntax.

          See: https://stackoverflow.com/questions/47470498/how-to-define-multiple-containers-in-declarative-pipeline

          Is this an intended limitation or an oversight?

           

          The default jnlp image is not suitable for my needs which means I have to try to mix up

          declarative and scripted or swap to scripted completely...

           

          Could this be resolved?

          Do I need to open a new ticket for this?

           

          Thanks.

          Shahar.

          Show
          bd82 Shahar Soel added a comment - - edited I think this may be missing some functionality. It seems only one containerTemplate can possibly be defined using the declarative syntax. See: https://stackoverflow.com/questions/47470498/how-to-define-multiple-containers-in-declarative-pipeline Is this an intended limitation or an oversight?   The default jnlp image is not suitable for my needs which means I have to try to mix up declarative and scripted or swap to scripted completely...   Could this be resolved? Do I need to open a new ticket for this?   Thanks. Shahar.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              abayer Andrew Bayer
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: