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

kubernetes-plugin should support multiple containers in declarative templates

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      e.g. something like this

      pipeline {
        agent {
          kubernetes {
            label 'mypod'
            podTemplate {
              containerTemplate {
                name 'maven'
                image 'maven:3.3.9-jdk-8-alpine'
                ttyEnabled true
                command 'cat'
              }
              containerTemplate {
                name 'node'
                image 'node:9.2'
                ttyEnabled true
                command 'cat'
              }
            }
          }
        }
        environment {
          CONTAINER_ENV_VAR = 'container-env-var-value'
        }
        stages {
          stage('Run maven') {
            steps {
              container('maven') {
                sh 'echo INSIDE_CONTAINER_ENV_VAR = ${CONTAINER_ENV_VAR}'
                sh 'mvn -version'
              }
            }
          }
          stage('Run npm') {
            steps {
              container('node') {
                sh 'echo INSIDE_CONTAINER_ENV_VAR = ${CONTAINER_ENV_VAR}'
                sh 'npm -version'
              }
            }
          }
        }
      }
      

          [JENKINS-48135] kubernetes-plugin should support multiple containers in declarative templates

          James Strachan created issue -
          James Strachan made changes -
          Link New: This issue is blocking JENKINS-46658 [ JENKINS-46658 ]
          Carlos Sanchez made changes -
          Link New: This issue is blocked by JENKINS-48050 [ JENKINS-48050 ]
          Carlos Sanchez made changes -
          Link New: This issue depends on JENKINS-46336 [ JENKINS-46336 ]
          Carlos Sanchez made changes -
          Assignee Original: Carlos Sanchez [ csanchez ] New: James Strachan [ jstrachan ]
          Carlos Sanchez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Frederic Rousseau made changes -
          Assignee Original: James Strachan [ jstrachan ] New: Andrew Bayer [ abayer ]
          Carlos Sanchez made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Carlos Sanchez made changes -
          Assignee Original: Andrew Bayer [ abayer ] New: Carlos Sanchez [ csanchez ]
          Carlos Sanchez made changes -
          Summary Original: kubernetes-plugin should support podTemplate in declarative templates New: kubernetes-plugin should support multiple containers in declarative templates
          Carlos Sanchez made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            csanchez Carlos Sanchez
            jstrachan James Strachan
            Votes:
            6 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: