-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins version 2.196
Kubernetes Plugin version 1.21
In scripted pipelines we can inherit a pod template that was defined in either jenkinsfile or shared library. As such there is no way to do the same with declarative pipeline.
For declarative pipelines we should define a pod template in Manage Jenkins -> Configure System and use them with "InheritFrom" in kubernetes agent block before yaml.
It would be helpful to support inheriting pod templates from shared libraries in declarative pipelines too. Our organization runs multiple pipelines with multple centos based containers. I would like to separate all pod infra configurations (like mounts, resources etc) in to shared libraries and inherit it in to build pod using yaml merge strategy. Defining all those pod templates in jenkins system configuration looks awkward though.