[MWCI-170] Take advantage of podTemplate inheritance instead of a YAML template file Created: 09/May/19  Updated: 10/Jul/19  Resolved: 10/Jul/19

Status: Closed
Project: Continuous Integration Infrastructure for Middleware Development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Enrico Vianello Assignee: Enrico Vianello
Resolution: Fixed Votes: 0
Labels: ci
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File test-docker-runner.png     PNG File test.png    

 Description   

Take advantage of podTemplate inheritance instead of the same huge YAML file to run CI jobs



 Comments   
Comment by Enrico Vianello [ 09/May/19 ]

Example of declarative pipeline with a containerTemplate based on a docker image:

pipeline {
    agent {
        kubernetes {
            cloud 'Kube mwdevel'
            label 'python-pod'
            inheritFrom 'test-docker-runner'
            containerTemplate {
                name 'python-runner'
                image "italiangrid/storm-info-provider:${env.BRANCH_NAME}"
                ttyEnabled true
                command 'cat'
                resourceRequestCpu '0.5'
                resourceLimitCpu '0.5'
                resourceRequestMemory '250Mi'
                resourceLimitMemory '250Mi'
            }
        }
    }
    ...
    stages {
        stage('tests') {
            steps {
                container('python-runner') {
                   ...
                }
            }
        }
    }
} 

 

Comment by Enrico Vianello [ 09/May/19 ]

Into 'Manage Jenkins' > 'Configure System' add the following podTemplates:

  • name: test
    namespace: ci
    Service Account: jenkinsci
    Node Selector: zone=ci
  • name: test-docker-runner
    Pod template to inherit from: test**

More details on attachments

Generated at Thu Jun 19 09:11:18 CEST 2025 using Jira 10.3.6#10030006-sha1:0dc21a711362757421d62af2e50bcb9585207f88.