Super Odd Behavior Helm/Jenkins/Artifactory YAML

Using YAML (with Helm), we created the following file to define agent containers. This file, as it stands below, works correctly as does another file with a different set of agent definitions.

apiVersion: v1
kind: Pod
metadata:
  name: pod-yaml
spec:
  containers:
  - name: maven
    image: maven:3.8.1-jdk-8
    command:
    - sleep
    args:
    - 99d
  - name: python
    image: python:latest
    command:
    - sleep
    args:
    - 99d
  - name: node10jdk8
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node10_jdk8:v4
    command:
    - sleep
    args:
    - 99d
  - name: node10jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node10_jdk11:v2
    command:
    - sleep
    args:
    - 99d
  - name: node12jdk8
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node12_jdk8:v2
    command:
    - sleep
    args:
    - 99d
  - name: node12jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node12_jdk11:v2
    command:
    - sleep
    args:
    - 99d
  - name: node14jdk8
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node14_jdk8:v2
    command:
    - sleep
    args:
    - 99d
  - name: node16jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node16_jdk11:v2
    command:
    - sleep
    args:
    - 99d
  - name: node18jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node18_jdk11:v2
    command:
    - sleep
    args:
    - 99d
  - name: node20jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node20_jdk11:v2
    command:
    - sleep
    args:
    - 99d
  - name: jra-base
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_base:v3
    command:
    - sleep
    args:
    - 99d

We had several more containers defined but we would get errors like this when running a Jenkins pipeline:

14:26:47  Created Pod: kubernetes jenkins-dev/agents-jenkins-yaml-agents-test-128-tlk8h-tnw11-gf62j
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_base:v3". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node12_jdk11:v2". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node12_jdk8:v2". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node14_jdk8:v2". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node16_jdk11:v2". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node18_jdk11:v2". Check if image tag name is spelled correctly.
14:26:53  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node20_jdk11:v2". Check if image tag name is spelled correctly.

I took all of the offending container images and placed them into a separate YAML file, ran the test and the test worked.

I decided then I would add one more image, test, lather rinse repeat. I add one image:

  - name: node16jdk17
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node16_jdk17:v2
    command:
    - sleep
    args:
    - 99d

And the error appeared again, but not with the new container definition that had been added. I removed that definition and it ran perfectly again. I decided to get another image to try and added this:

  - name: node14jdk11
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node14_jdk11:v2
    command:
    - sleep
    args:
    - 99d

And it failed, but this time only the new image showed as failing:

13:10:58  [Pipeline] node
13:11:08  Created Pod: kubernetes jenkins-dev/agents-jenkins-yaml-agents-test-125-93416-q6bzf-bqr63
13:11:12  ERROR: Unable to pull Docker image "ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node14_jdk11:v2". Check if image tag name is spelled correctly.
13:11:12  [Pipeline] // node

What am I missing here? The YAML files aren’t approaching a length restriction, as far as I know. The image tag names must be “spelled correctly” as the artifacts are retrieved when none of these additions are made. I have checked and double-checked the syntax. There are no weird characters in the file.

Am I missing something really obvious?

UPDATE

Here is a bare-bones version of a pipeline using the pod/container definitions:

@Library('SCMLibraries@jenkins-pod-tests')_ // Load External Libraries
def podDefs = libraryResource('./pod.yaml') 
pipeline {
    agent any
    environment {
        PATH = '/var/jenkins/.nvm/versions/node/v10.24.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin'
        NVM_DIR = '/var/jenkins/.nvm'
        NVM_INC = '/var/jenkins/.nvm/versions/node/v10.24.1/include/node'
        NVM_CD_FLAGS = ''
        NVM_BIN = '/var/jenkins/.nvm/versions/node/v10.24.1/bin'
    }
    stages {
        stage('Setup the Build') {
            agent {
                kubernetes {
                    defaultContainer 'jnlp'
                    yaml podDefs
                }
            }
            steps {
                container('node10jdk8') {
                    // code goes here
                }
            }
        }
    }
}

Not shown is the parallel processing pipeline in which multiple containers would be used.

7

Because pod.yaml is called as a resource it does not inherit the service account used for the Jenkins instance on Kubernetes. We created a separate service account for the pods and then included it in the YAML file:

apiVersion: v1
kind: Pod
metadata:
  name: pod-yaml
spec:
  serviceAccountName: agent-pods
  containers:
  - name: maven
    image: maven:3.8.1-jdk-8
    command:
    - sleep
    args:
    - 99d
  - name: python
    image: python:latest
    command:
    - sleep
    args:
    - 99d
  - name: node10jdk8
    image: ourartifacts.jfrog.io/docker-local/jenkins_remote_agent_node10_jdk8:v4
    command:
    - sleep
    args:
    - 99d

pod.yaml was using the default service account which did not have access to some of the resources. (Which also highlighted that we need to determine why it did allow some, but that’s another story.) Adding a service account for these calls solves the issue.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật