Configure LMCTL Jenkins slave
Configuring an Lmctl Jenkins slave
This guide assumes the following:
- Jenkins has been installed and the UI is accessible
- You have Kubectl installed and configured to access the Kubernetes cluster Jenkins is running on
- You have access to a Stratoss™ Lifecycle Manager (LM) you intend to use for testing
- You have a valid LMCTL configuration file configured to allow LMCTL to access the LM environment above
Choose LMCTL Jnlp Image
Select a version of the lmctl-jnlp-slave image from Dockerhub.
Create LMCTL Config Map
Create a new configmap in Kubernetes with
kubectl, providing the the LMCTL configuration file as data:
kubectl create configmap lmctl-slave-config -n lm --from-file <your-lmctl-config-file>
Add Template to Jenkins
Navigate to the cloud settings in the Jenkins UI (Manage Jenkins->Configure System->Kubernetes->Images)
Add a new Jnlp slave by selecting the
Add Pod Templatebutton
Configure the template as follows, changing the image name to match the lmctl-jnlp-slave you have selected:
Save the template
The template is now configured to create a new pod for any Jenkins job which requests an agent with the
Changing configuration of an existing Lmctl Jenkins slave
To update the LMCTL configuration used on any slave pods you need to re-create the configmap with the updated LMCTL config file:
kubectl create configmap lmctl-slave-config -n lm --from-file <your-updated-lmctl-config-file> -n lm
Configure Additional Slaves
There are very few use cases for configuring additional LMCTL slave templates to Jenkins as the existing template will be used any time a slave with LMCTL is required.
If you need to use different Stratoss™ Lifecycle Manager environments in each Jenkins job, you can update the configmap with an updated LMCTL config file featuring all of the potential environments.
It may be reasonable to configure an additional slave if you need an alternative version of LMCTL (or want to try out a new version without losing your old slave template). If this is the case, follow the Configure Slave instructions for the additional template, changing the names of the configmap and Jnlp template name to a unique value.