I am trying to define some additional agents in my Jenkins instance (using Helm charts for “ease”) and the documentation is not well-defined.
I defined a pod in the values.yaml file of my Helm chart:
podTemplates:
python: |
- name: python
label: jenkins-python
serviceAccount: jenkins
namespace: helm-agents
containers:
- name: python
customJenkinsLabels: jenkins-python
image: python:3
command: "/bin/sh -c"
args: "cat"
ttyEnabled: true
privileged: true
resourceRequestCpu: "400m"
resourceRequestMemory: "512Mi"
resourceLimitCpu: "1"
resourceLimitMemory: "1024Mi"
I can see the pod template in Manage Jenkins->Clouds->Kubernetes->Pod Templates
Then I defined an additional agent, which should use the pod:
additionalAgents:
python:
podName: python
customJenkinsLabels: jenkins-python
image: python
tag: "3"
TTYEnabled: true
I have gotten the following errors:
‘Jenkins’ doesn’t have label ‘jenkins-python’
or
11:17:48 Still waiting to schedule task
11:17:48 ‘python-x897h’ is offline
All while running the simplest of pipelines:
pipeline {
agent {
node {
label "jenkins-python"
}
}
stages {
stage ('agent-check') {
steps {
sh "cat /etc/*release"
sh "which python"
}
}
}
}
At this point, I have done so much tweaking that I have gotten a bit lost. I feel like I am missing something quite obvious.
I feel as if I am close to having this working properly OR I am in a completely different ballpark than where the problem exists.
Do the additional agents not use the pods designated in the podTemplates
?