Jenkins System Settings
Jenkins is powerful and flexible and it has become the de facto standard for CI/CD workflows. Nevertheless, many plugins require users to set system-level configurations before they can be put to use.
The KubeSphere DevOps System offers containerized CI/CD functions based on Jenkins. To provide users with a schedulable Jenkins environment, KubeSphere uses Configuration as Code for Jenkins system settings, which requires users to log in to the Jenkins dashboard and reload the configuration after it is modified. In the current release, Jenkins system settings are not available on the KubeSphere console, which will be supported in upcoming releases.
This tutorial demonstrates how to set up Jenkins and reload configurations on the Jenkins dashboard.
Prerequisites
You have enabled the KubeSphere DevOps System.
Jenkins Configuration as Code
KubeSphere has the Jenkins Configuration as Code plugin installed by default to allow you to define the desired state of your Jenkins configuration through YAML files and makes it easy to reproduce your Jenkins configurations including plugin configurations. You can find descriptions about specific Jenkins configurations and example YAML files in this directory.
Besides, you can find the formula.yaml
file in the repository ks-jenkins, where you can view plugin versions and customize these versions based on your needs.
Modify the ConfigMap
It is recommended that you configure Jenkins in KubeSphere through Configuration as Code (CasC). The built-in Jenkins CasC file is stored as a ConfigMap.
-
Log in to KubeSphere as
admin
. Click Platform in the upper-left corner and select Cluster Management. -
If you have enabled the multi-cluster feature with member clusters imported, you can select a specific cluster to edit the ConfigMap. If you have not enabled the feature, refer to the next step directly.
-
On the left navigation pane, select ConfigMaps under Configuration. On the ConfigMaps page, select
kubesphere-devops-system
from the drop-down list and clickjenkins-casc-config
. -
On the details page, click Edit YAML from the More drop-down list.
-
The configuration template for
jenkins-casc-config
is a YAML file under thedata.jenkins_user.yaml:
section. You can modify the container image, label, resource requests and limits, etc. in the broker (Kubernetes Jenkins agent) in the ConfigMap or add a container in the podTemplate. When you finish, click OK. -
Wait for at least 70 seconds until your changes are automatically reloaded.
-
For more information about how to set up Jenkins via CasC, see the Jenkins documentation.
Note
In the current version, not all plugins support CasC settings. CasC will only overwrite plugin configurations that are set up through CasC.
Feedback
Was this page Helpful?
Receive the latest news, articles and updates from KubeSphere
Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.