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

PodTemplate definition in Kubernetes cloud settings is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins docker image jenkins/jenkins:2.141-alpine
      Kubernetes plugin 1.12.6

      When i try to define global podTemplate in Cloud settings it's definition is ignored.
      When i try to run this basic pipeline:

      pipeline {
        agent {
          kubernetes {
            label 'kubernetes'
            cloud 'kubernetes'
          }
        }
        stages {
          stage('test') {
            steps {
              container('kubectl') {
                sh "kubectl version"
              }
            }
          }
        }
      }
      

      I get following error:

      java.io.IOException: container [kubectl] does not exist in pod [kubernetes-wkdgf-91gvj]
      

      If I describe this pod before it gets terminated i see that there is only one default jnlp container defined. So basically globally defined podTemplate is ignored.

      I'm attaching "clouds" part of my config.xml. Can provide any additional info required.

            csanchez Carlos Sanchez
            zarbis Vadim Gusev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: