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

Unable to override global config pod template in pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • jenkins 2.166
      kubernetes: 1.14.2
      kubernetes-pipeline: 1.5

      Our jenkins instance has a kubernetes pod template that's defined as the defaults provider, named `jenkins slave`

      `jenkins slave` contains  single jnlp container template with a docker image defined, also containing working directory and the jnlp args ${computer.jnlpmac} ${computer.name} plus resource allocations and some environment variables

      In my pipeline i have a kube-slave.yml defined that gets loaded with

          agent {
              kubernetes {
                  cloud 'jenkins-jenkins'
                  label label()
                  defaultContainer 'jnlp'
                  yamlFile 'kube-slave.yaml' 
              }
          }
      

      A sample of the yaml file is attached.

      And the yaml file overrides the `jnlp` container with one that has a different image and resource requirements.  However when the plugin attempts to combine the two templates, i end up with Combined parent + template where the override's name and env vars among other things are the overridden values, but the container itself its resource limits are the ones that were defined in the default provider.

            iocanel Ioannis Canellos
            lzridge_04 Lucas Ridge
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: