The expected override in the helm chart of the Docker agent image isn’t working as expected

The expected override in the helm chart of the Docker agent image isn’t working as expected.

I’ve built Jenkins and the jenins-agent Docker images for RISC-V. This allows me to run Jenkins on a 100% RISC-V Kubernetes cluster.

git clone https://github.com/jenkinsci/docker.git
cd docker
git checkout 2.504.3

sudo docker build -f debian/trixie/hotspot/Dockerfile . \
--build-arg JENKINS_VERSION=2.528.3 \
--build-arg WAR_SHA=bfa31f1e3aacebb5bce3d5076c73df97bf0c0567eeb8d8738f54f6bac48abd74 \
--build-arg WAR_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/2.528.3/jenkins-war-2.528.3.war \
--build-arg COMMIT_SHA=1d22f3716cc2a5baeedeb636a006c4c38d35ce4c \
--build-arg PLUGIN_CLI_VERSION=2.13.2 \
--build-arg TRIXIE_TAG=20251208 \
--build-arg JAVA_VERSION=21.0.9_10 \
--build-arg TARGETARCH=riscv64 \
-t opvolger/jenkins:2.528.3-jdk21 --progress plain

and

git clone https://github.com/jenkinsci/docker-agent.git

cd docker-agent
git checkout 3345.v03dee9b_f88fc-1
sudo docker build -f debian/Dockerfile . \
--build-arg JAVA_VERSION=21.0.9_10 \
-t opvolger/inbound-agent:3345.v03dee9b_f88fc-1 --progress plain
sudo docker push opvolger/inbound-agent:3345.v03dee9b_f88fc-1

and

# kubectl create namespace jenkins
# helm install jenkins jenkins/jenkins -n jenkins --values values.yaml
# helm upgrade jenkins jenkins/jenkins -n jenkins --values values.yaml
# helm uninstall jenkins -n jenkins

global:
  domain: k8s.riscv.net

jenkinsUrlProtocol: "http"

agent:
  image:
    repository: "opvolger/inbound-agent"
    tag: "3345.v03dee9b_f88fc-1"
controller:
  admin:
    username: opvolger
    password: demodemo
  probes:
    startupProbe:
      failureThreshold: 20
      periodSeconds: 15
      timeoutSeconds: 30
    livenessProbe:
      failureThreshold: 10
      initialDelaySeconds: 30
    readinessProbe:
      failureThreshold: 10
      initialDelaySeconds: 30
  image:
    repository: opvolger/jenkins
  sidecars:
    configAutoReload:
      enabled: false # crashed al the time
      image:
        repository: opvolger/k8s-sidecar
  ingress:
    enabled: true
    hostName: "{{ .Release.Name }}.{{ .Values.global.domain }}"

However, I’m still running into one issue. I’ve overwritten the Docker images agent.image.repository with my image. I also see this reflected in the default PodTemplate settings for my cluster.

However, when I create a job, it still tries to pull the jenkins/inbound-agent Docker image. This isn’t available for RISC-V.

So, I’ve solved it with a small hack, but I don’t think it’s the prettiest. I’ve also overwritten the image (jnlp) in the pipeline, which works.

// Uses Declarative syntax to run commands inside a container.
pipeline {
    agent {
        kubernetes {
            yaml '''
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: jnlp
    image: opvolger/inbound-agent:3345.v03dee9b_f88fc-1
  - name: shell
    image: ubuntu
    command:
    - sleep
    args:
    - infinity
    securityContext:
      # ubuntu runs as root by default, it is recommended or even mandatory in some environments (such as pod security admission "restricted") to run as a non-root user.
      runAsUser: 1000
'''
            defaultContainer 'shell'
            retries 2
        }
    }
    stages {
        stage('Main') {
            steps {
                sh 'uname -a'
            }
        }
    }
}

This hack is not what i want. What am I doing wrong? Or is this the desired behavior?

Jenkins setup:

Jenkins: 2.528.3
OS: Linux - 6.12.57+deb13-riscv64
Java: 21.0.9 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
asm-api:9.9.1-189.vb_5ef2964da_91
authentication-tokens:1.144.v5ff4a_5ec5c33
bootstrap5-api:5.3.8-895.v4d0d8e47fea_d
bouncycastle-api:2.30.1.82-277.v70ca_0b_877184
branch-api:2.1268.v044a_87612da_8
caffeine-api:3.2.3-194.v31a_b_f7a_b_5a_81
cloudbees-folder:6.1073.va_7888eb_dd514
commons-lang3-api:3.20.0-109.ve43756e2d2b_4
commons-text-api:1.15.0-210.v7480a_da_70b_9e
configuration-as-code:2006.v001a_2ca_6b_574
credentials:1462.v21d5e767269e
credentials-binding:702.vfe613e537e88
display-url-api:2.217.va_6b_de84cc74b_
durable-task:639.vefb_3d8372f6d
font-awesome-api:7.1.0-882.v1dfb_771e3278
git:5.8.1
git-client:6.5.0
gson-api:2.13.2-173.va_a_092315913c
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:94.vcc3065403257
jackson2-api:2.20.1-423.v13951f6b_6532
jakarta-activation-api:2.1.4-1
jakarta-mail-api:2.1.5-1
jakarta-xml-bind-api:4.0.6-12.vb_1833c1231d3
javax-activation-api:1.2.0-8
jaxb:2.3.9-143.v5979df3304e6
joda-time-api:2.14.0-149.v1c3ce991d1b_9
json-api:20251224-185.v0cc18490c62c
kubernetes:4398.vb_b_33d9e7fe23
kubernetes-client-api:7.3.1-256.v788a_0b_787114
kubernetes-credentials:207.v492f58828b_ed
mailer:525.v2458b_d8a_1a_71
metrics:4.2.37-489.vb_6db_69b_ce753
mina-sshd-api-common:2.16.0-167.va_269f38cc024
mina-sshd-api-core:2.16.0-167.va_269f38cc024
okhttp-api:4.12.0-195.vc02552c04ffd
pipeline-build-step:571.v08a_fffd4b_0ce
pipeline-groovy-lib:787.ve2fef0efdca_6
pipeline-input-step:540.v14b_100d754dd
pipeline-milestone-step:138.v78ca_76831a_43
pipeline-model-api:2.2277.v00573e73ddf1
pipeline-model-definition:2.2277.v00573e73ddf1
pipeline-model-extensions:2.2277.v00573e73ddf1
pipeline-stage-step:322.vecffa_99f371c
pipeline-stage-tags-metadata:2.2277.v00573e73ddf1
plain-credentials:199.v9f8e1f741799
plugin-util-api:6.1192.v30fe6e2837ff
prism-api:1.30.0-630.va_e19d17f83b_0
scm-api:724.v7d839074eb_5c
script-security:1385.v7d2d9ec4d909
snakeyaml-api:2.5-143.v93b_c004f89de
ssh-credentials:361.vb_f6760818e8c
structs:362.va_b_695ef4fdf9
variant:70.va_d9f17f859e0
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1384.vdc05a_48f535f
workflow-basic-steps:1098.v808b_fd7f8cf4
workflow-cps:4238.va_6fb_65c1f699
workflow-durable-task-step:1464.v2d3f5c68f84c
workflow-job:1559.va_a_533730b_ea_d
workflow-multibranch:821.vc3b_4ea_780798
workflow-scm-step:466.va_d69e602552b_
workflow-step-api:710.v3e456cc85233
workflow-support:1010.vb_b_39488a_9841

Found the solution: you have to set the template on your default template. empty string is not working (out of the box there is an empy string).

That works for me, the template is now working.