< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Jenkins System Settings

The DevOps system provides containerized CI/CD functionalities based on Jenkins. As the standard for CI/CD workflows, Jenkins is powerful and flexible. However, many plugins require users to perform system-level configurations before using Jenkins.

To provide a schedulable Jenkins environment, KubeSphere adopts the Configuration as Code approach for Jenkins system settings. Users need to log in to the Jenkins dashboard, modify the configurations, and then reload them.

This document demonstrates how to set up Jenkins and reload configurations on the Jenkins dashboard.

Prerequisites

DevOps must have been installed and enabled.

Jenkins Configuration as Code

KubeSphere installs the Jenkins Configuration as Code plugin by default, which supports defining the desired state of Jenkins through YAML files, making it easy to reproduce Jenkins configurations (including plugin configurations). Refer to this directory for specific Jenkins configurations and example YAML files.

Additionally, you can find the formula.yaml file in the ks-jenkins repository to view plugin versions and customize these versions as needed.

Modify ConfigMap

It is recommended to configure Jenkins in KubeSphere through Configuration as Code (CasC). The built-in Jenkins CasC file is stored as a ConfigMap.

  1. Log in to the KubeSphere web console as the platform-admin user.

  2. Click Cluster Management and enter a cluster.

  3. In the left navigation pane, select Configuration > ConfigMaps. On the ConfigMaps page, select kubesphere-devops-system from the list, then click jenkins-casc-config.

  4. On the details page, click More and select Edit YAML from the dropdown list.

  5. The configuration template for jenkins-casc-config is a YAML file located under data:jenkins_user.yaml:. Modify the container image, labels, resource requests (Request), and limits (Limit) in the ConfigMap’s agent (Kubernetes Jenkins Agent), or add containers in the podTemplate. After completing the operations, click OK.

  6. Wait for 1 to 2 minutes, and the new configuration will be reloaded automatically.

Note
  • For more information on how to configure Jenkins through CasC, refer to Jenkins Documentation.

  • In the current version, not all plugins support CasC settings. CasC only overrides plugin configurations set through CasC.

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.