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

custom image ignored by kubernetes plugin.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Jenkins: 2.263.3
      Kubernetes plugin: 1.28.7
      Kubernetes API plugin: 4.11.1

      When setting up a pod with a custom image, it appears the image key within the yaml sent to Kubernetes contains two image keys. One is the custom image that I defined <private docker registry>/jenkins-inbound:bionic-jdk11 and the other is jenkins/inbound-agent:4.3-4.

      This creates an issue where all operations are ran on the later image (jenkins/inbound-agent:4.3-4), and not my custom image.

       

      ---
       apiVersion: "v1"
       kind: "Pod"
       metadata:
         labels:
           jenkins: "agent"
           app.kubernetes.io/managed-by: "jenkins"
           jenkins/label: "k8s-jdk8-wip"
           jenkins/label-digest: "2ad391d593c63b19416b9dd75b9ab723b8aa17c7"
         name: "pod-jdk8-4vmjc"
       spec:
         containers:
         - args:
           - "9999999"
           command:
           - "sleep"
           image: "<private docker registry>/jenkins-inbound:bionic-jdk11"
           imagePullPolicy: "Always"
           name: "jdk11"
           resources:
             limits: {}
             requests: {}
           tty: false
           volumeMounts:
           - mountPath: "/srv/cache"
             name: "volume-0"
             readOnly: false
           - mountPath: "/home/jenkins/agent"
             name: "workspace-volume"
             readOnly: false
           workingDir: "/home/jenkins/agent"
         - env:
           - name: "JENKINS_PROTOCOLS"
             value: "JNLP4-connect"
           - name: "JENKINS_SECRET"
             value: "********"
           - name: "JENKINS_AGENT_NAME"
             value: "pod-jdk8-4vmjc"
           - name: "JENKINS_DIRECT_CONNECTION"
             value: "jenkins.********:42232"
           - name: "JENKINS_INSTANCE_IDENTITY"
             value: "********""
           - name: "JENKINS_NAME"
             value: "pod-jdk8-4vmjc"
           - name: "JENKINS_AGENT_WORKDIR"
             value: "/home/jenkins/agent"
           image: "jenkins/inbound-agent:4.3-4"
           name: "jnlp"
           resources:
             limits: {}
             requests:
               memory: "256Mi"
               cpu: "100m"
           volumeMounts:
           - mountPath: "/srv/cache"
             name: "volume-0"
             readOnly: false
           - mountPath: "/home/jenkins/agent"
             name: "workspace-volume"
             readOnly: false
         hostNetwork: false
         nodeSelector:
           kubernetes.io/os: "linux"
         restartPolicy: "Never"
         volumes:
         - name: "volume-0"
           persistentVolumeClaim:
             claimName: "netapp"
             readOnly: false
         - emptyDir:
             medium: ""
           name: "workspace-volume"
      

            Unassigned Unassigned
            mdelaney Mike Delaney
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: