Possibility of setting priorityClassName in pod template configuration and via yamlMergeStrategy: merge with yaml section#2814
Conversation
…n and via yamlMergeStrategy: merge with yaml section
|
Woho! CI passed!!! |
|
Why would we need this? Anything but the most elementary configuration should be done via |
|
@jglick I described it in issue: #2813 Check below case: If we want to have one base pod template which will contain all configuration regarding containers (as below label called Thats why i added mechanism to set:
Below example of config - with my change there will be option to set |
YAML merge never worked very well. I do not recommend using it. Better (IMO) for a pipeline to use the |
|
The main reason for introducing this is to reduce configuration duplication. In my setup, labels are predefined in JCasC, and pipelines reference them using So imo it is better to extend what is already possible to modify with This change also allows configuring priorityClass in the podTemplate (as below). The implementation closely follows the mechanism already used for nodeSelector - https://plugins.jenkins.io/kubernetes/#plugin-content-pod-template. |
This is why i added that change to cover more cases. I do not understand why we don't want to improve something that is already here. If its not recommended then maybe lets deprecate merge option of |
It is one usage mode of course, but
Might be a good idea, though I am not sure how to communicate it clearly. Fine if some maintainer (if there is one…) wants to merge this PR, but I have watched many of these PRs get filed and the number of configurable fields in pod templates grows and grows and it is never enough for what someone needs. |
I can shrink that PR to only fix the
Can we ask someone else then for their opinion - if this PR is fine at this state or i should cover only setting |
GitHub issue
#2813
TL;DR
This change adds support for configuring Kubernetes pod priorityClassName in Jenkins Kubernetes plugin pod templates, and ensures it is preserved when templates are merged (including YAML merge strategy).
What’s included
-- podTemplate step (PodTemplateStep + execution path)
-- Declarative Kubernetes agent (KubernetesDeclarativeAgent)
Included snippet/argument map support so pipeline generation/roundtrip includes the new field.
Behavior
Tests
Testing done
Tested cases:
Casc template definitions:
screenshot 1)

screenshot 2)

screenshot 3)

screenshot 4)

Submitter checklist