<p>i am using kubernetes plugin in jenkins.i want to run an init script before slave container provision on kubernetes.the kubernetes plugin pod template won't allow me to or i cannot find a way to run it.can anybody please help me with this.i need to run a certain set of commands on the kubernetes slave container before it provisions.this is how my config looks like
<a href="https://i.stack.imgur.com/Eq5Ui.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Eq5Ui.png" alt="enter image description here" /></a></p>

Shaswat Vashistha
<p>1 - You don't need to use the slave image, jenkins will have an agent container regardless, you should only specify containers you want it to run additionally.</p>
<p>2 - On the containers you can specify the entrypoints or pre-provision whatever you want beforehand and just worry about the execution. That means you can get a container ready to go and assume the code will be there, if you need to run any extra commands on the code, you can just add an extra script step</p>
<p>3 - In order for your step to be executed in a container, you have to be explicit in your pipeline, otherwise it will run on the master.</p>
<p>I can't really guide you to using the UI because I use the Jenkinsfile inside projects I want to build.</p>
