Jenkins template folder is there to help you get started with Declarative Jenkins pipeline with a kubernetes agent. To use the template folder, follow the following steps:
- Copy
jenkins-template
folder to your repository and rename it to a more appropriate name, maybejenkins
. - Open up Jenkinsfile and change
label-name
(on line 4) to an appropraite label-name that would suit your project. - Navigate to
agent.yaml
file and changecontainer-name
(on line 8) to an appropriate value, you would be using this value under your steps to let Jenkins know on which container you would like to carry out your commands in. - While on
agent.yaml
file, changeimage-name
(on line 9) to an image you would like to use for the particular container. - If you would like to alter
resources
block, feel free to do so, just make sure you do not allocate more resources than a node can sustain.