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

The secretVolume is not mounted to "jnlp" container in the multicontainer pod

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins 2.117
      Kubernetes Plugin 1.5.2
      Kubernetes 1.9.5 or
      OpenShift 3.7.0 with Kubernetes 1.7.6

      The Kubernetes Plugin stopped mounting secret volumes to a "jnlp" container after plugin was upgraded to the version 1.5.2.

      The sample pod template definition:

      podTemplate(label: 'jpod', cloud: 'OpenShift', serviceAccount: 'jenkins-sa',
        containers: [
          containerTemplate(name: 'java', image: 'openjdk:alpine', ttyEnabled: true, command: 'cat'),
          containerTemplate(name: 'docker', image: 'docker:dind', ttyEnabled: true, command: 'cat', privileged: true,
              envVars: [secretEnvVar(key: 'DOCKER_USERNAME', secretName: 'docker-hub-credentials', secretKey: 'username'),
          ]),
          containerTemplate(name: 'kubectl', image: 'roffe/kubectl', ttyEnabled: true, command: 'cat'),
          containerTemplate(name: 'sonarqube', image: 'iktech/sonarqube-scanner', ttyEnabled: true, command: 'cat'),
        ],
        volumes: [
          secretVolume(mountPath: '/etc/.ssh', secretName: 'ssh-home'),
          secretVolume(mountPath: '/opt/sonar-scanner/conf', secretName: 'sonar-scanner.properties'),
          secretVolume(secretName: 'docker-hub-credentials', mountPath: '/etc/.secret'),
          hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')
        ]
      ) {
      .....

      Expected behaviour is that each volume is mounted to all the defined containers in the pod. In reality, volumes are mounted to all the containers except the default one (jnlp).

      It worked perfectly ok before the plugin was upgraded.

      After downgrading plugin to version 1.5.1 it works again as expected.

            csanchez Carlos Sanchez
            ikolomiyets Igor Kolomiyets
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: