-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: kubernetes-plugin
-
Environment:Jenkins 2.319.1
kubernetes plugin 1.31.2 3724.v0920c1e0ec69
pipeline 2.6
pipeline script
Â
pipeline {
 agent {
  kubernetes {
   inheritFrom 'maven'
   yaml '''
   spec:
    containers:
    - name: maven
     image: my-mavenimage
     volumeMounts:
     - mountPath: "/root/.m2"
      subPath: mvn_cache
      name: "volume-cache"
      readOnly: false
     - mountPath: "/root/.sonar/cache"
      subPath: sonar-cache
      name: "volume-cache"
      readOnly: false
    - name: jnlp
     volumeMounts:
     - mountPath: "/root/.sonar/cache"
      subPath: sonar-cache
      name: "volume-cache"
      readOnly: false
     - mountPath: "/root/.m2"
      subPath: mvn_cache
      name: "volume-cache"
      readOnly: false
    volumes:
    - persistentVolumeClaim:
      claimName: rule
     name: "volume-cache"
'''
   defaultContainer 'maven'
  }
 }
parent pod template casc
Â
Â
-containers: -command:"cat" image:"parent image" livenessProbe: failureThreshold:0 initialDelaySeconds:0 periodSeconds:0 successThreshold:0 timeoutSeconds:0 name:"maven" resourceLimitCpu:"4000m" resourceLimitMemory:"8192Mi" resourceRequestCpu:"100m" resourceRequestMemory:"100Mi" ttyEnabled:true workingDir:"/home/jenkins/agent"
Â
The pod is still started using the parent image, pod log
spec:
containers:
- command:
- "cat"
image: "parent image"
imagePullPolicy: "IfNotPresent"
name: "maven"
resources: