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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major
    • Component/s: kubernetes-plugin
    • Environment:
      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.

            Assignee:
            Carlos Sanchez
            Reporter:
            Igor Kolomiyets
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: