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

When multiple builds are started at the same time, the POD is not created according to the specified yaml file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • kubernetes-plugin
    • None
    • Kubernetes plugin 1.14.9
      Jenkins 2.150.3

      When multiple builds are started at the same time, the POD is not created according to the specified yaml file, but when I only start 1 build, he works normally.

       

      Jenkins log start error  pod 

      Still waiting to schedule task
      'mypod-tnk3s-bc8q0' is offline
      Agent mypod-tnk3s-bc8q0 is provisioned from template Kubernetes Pod Template
      Agent specification [Kubernetes Pod Template] (mypod): 
      yaml:
      
      metadata:
        labels:
          some-label: some-label-value
      spec:
        containers:
        - name: jnlp
          env:
          - name: CONTAINER_ENV_VAR
            value: jnlp
        - name: docker
          image: docker:stable-dind
          securityContext:
            privileged: true
          tty: true
        - name: kubectl
          image: rancher/pipeline-tools:v0.1.0
          tty: true
          volumeMounts:
          - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
            name: jenkins-token-26tqh
            readOnly: true
        volumes:
        - name: jenkins-token-26tqh
          secret:
            defaultMode: 420
            secretName: jenkins-token-26tqh
      

      My Jenkinsfile in my git 

      pipeline {
        agent {
          kubernetes {
            label 'mypod'
            defaultContainer 'jnlp'
            yaml """
      metadata:
        labels:
          some-label: some-label-value
      spec:
        containers:
        - name: jnlp
          env:
          - name: CONTAINER_ENV_VAR
            value: jnlp
        - name: yarn
          image: registry-vpc.cn-beijing.aliyuncs.com/pcss-cloud/node-yarn:10.15
          imagePullSecrets:
            - name: aliyun-vpc
          tty: true
        - name: docker
          image: docker:stable-dind
          securityContext:
            privileged: true
          tty: true
        - name: kubectl
          image: rancher/pipeline-tools:v0.1.0
          tty: true
          volumeMounts:
          - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
            name: jenkins-token-26tqh
            readOnly: true
        volumes:
        - name: jenkins-token-26tqh
          secret:
            defaultMode: 420
            secretName: jenkins-token-26tqh
          """
          }
        }
        stages {
      ...
      ...
      }
      
      

       

       

            csanchez Carlos Sanchez
            a344166929 liu huan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: