Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60339

Inherit pod template from shared library for declarative pipeline

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • 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.

            Unassigned Unassigned
            hkrpavan Kalyana Pavan Hemadri
            Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: