Retain Jenkins Configuration Parameters¶
The Jenkins configuration file is stored through a ConfigMap. However, in actual use, you may modify some configuration items, such as the Agent image or the maximum number of parallel executors. Upgrading through Helm will overwrite your configurations. To balance the difference between the Jenkins upgrade and your custom configurations, the Workbench provides the feature of retaining Jenkins configuration parameters.
Tip
Workbench version >= v0.33.0, or installer version >= v0.24.0
Configuration Steps¶
- Click ≡ in the upper left corner to open the navigation bar, select Container Management -> Clusters, find
kpanda-global-cluster, and click the name of the cluster. - On the cluster details page, click ConfigMaps and Secrets -> ConfigMaps in sequence, select the namespace
amamba-system, and search by the nameglobal-jenkins-casc-config. -
Click Edit YAML and add the following configuration to the
datafield:kind: ConfigMap apiVersion: v1 metadata: name: global-jenkins-casc-config namespace: amamba-system data: jenkins.yaml: | # Edit this part xxxxxAmong them,
jenkins.yamlmust be in the same format as thejenkins.yamlin the Jenkins CASC configuration item. After you complete the modification, its content will be merged into the Jenkins configuration file in the form ofpatch.
Tip
The Jenkins CASC configuration item refers to the parameters that Jenkins can configure through a configuration file (Configuration as Code). You can go to the namespace where Jenkins is installed and view the jenkins-casc-config ConfigMap, whose key is jenkins.yaml.
Note
If only Jenkins is upgraded, since the upgrade of Jenkins cannot be detected, you need to manually update the amamba.io/casc-sync-at field in the annotation of this ConfigMap (you can change it to any value) so that it can be applied to Jenkins.
Configuration Examples¶
Some configuration examples are given below:
-
Add an agent
-
Set the maximum number of parallel agents
-
Add a shared library configuration: