I'm using Jenkins configuration as code (JCASC).
I'm having a pod template and I want to add NodeSelector + Tolerations. podTemplate doesn't support key of tolerations and NodeSelector so I need to add pod YAML spec...
agent:
enabled: true
podTemplates:
podTemplates:
jenkins-slave-pod: |
- name: jenkins-slave-pod
label: global-slave
serviceAccount: jenkins
idleMinutes: "15"
containers:
- name: main
image: 'xxxxxx.dkr.ecr.us-west-2.amazonaws.com/jenkins-slave:ecs-global'
command: "sleep"
args: "30d"
privileged: true
I was thinking of adding yaml: and just configuring the spec of the pod... But when I'm adding yaml: and adding yamlStrategy: merge/overrid it ignores the YAML it and only uses my podTemplate instead.
How can I merge/override my podTemplate and add pod with tolerations/nodeSelecotr?
Thats the YAML I want to have inside my podTemplate:
apiVersion: v1
kind: Pod
serviceAccount: jenkins-non-prod
idleMinutes: "15"
containers:
- name: main
image: 'xxxxxxxx.dkr.ecr.us-west-2.amazonaws.com/jenkins-slave:ecs-global'
command: "sleep"
args: "30d"
privileged: true
spec:
nodeSelector:
karpenter.sh/provisioner-name: jenkins-provisioner
tolerations:
- key: "jenkins"
operator: "Exists"
effect: "NoSchedule"