-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
k8s: 1.11.1
docker: 17.03.2
kubernetes-plugin: 1.12.4
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
- is related to
-
JENKINS-56082 Merge yaml from parent pod template
- Resolved