[JIRA] (JENKINS-53573) scripted volumes are not mounted into yaml defined pods

2 views
Skip to first unread message

askannon@flexarc.com (JIRA)

unread,
Sep 14, 2018, 5:15:02 AM9/14/18
to jenkinsc...@googlegroups.com
Thorsten Kunz created an issue
 
Jenkins / Bug JENKINS-53573
scripted volumes are not mounted into yaml defined pods
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Components: kubernetes-plugin
Created: 2018-09-14 09:14
Environment: k8s: 1.11.1
docker: 17.03.2
kubernetes-plugin: 1.12.4
Priority: Minor Minor
Reporter: Thorsten Kunz

When using a combination of yaml pod definition plus regular script volumes the volumes are not automatically mounted into the pod:

 

def label = "minion-backend-${UUID.randomUUID().toString()}"
podTemplate(
    label: label, yaml: """
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: maven
    image: maven:3.5.3-jdk-8
    securityContext:
      runAsUser: 10000
    command:
    - cat
    tty: true
    env:
    - name: MAVEN_CONFIG
      value: /home/jenkins/.m2
    - name: MAVEN_OPTS
      value: '-Xmx2048m -Duser.home=/home/jenkins'
"""
,
    volumes: [
      secretVolume(secretName: 'maven-secret', mountPath: '/home/jenkins/.m2'),
      persistentVolumeClaim(claimName: 'maven-repo', mountPath: '/home/jenkins/.m2repo')
    ],
    imagePullSecrets: ['regcred']
  ) {
    node(label) {
        stage('Checkout source') {
            }
        }
}

In order to mount the scripted volumes we need to add the following section to the yaml spec:

    volumeMounts:
    - mountPath: /home/jenkins/.m2
      name: volume-0
    - mountPath: /home/jenkins/.m2repo
      name: volume-1
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:43:28 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
Change By: Jesse Glick
Assignee: Carlos Sanchez
Reply all
Reply to author
Forward
0 new messages